无法通过 XAMPP 和 phpMyAdmin 访问 MySQL

2022-01-05 00:00:00 macos xampp mysql phpmyadmin

我正在使用 XAMPP 并尝试通过 http://localhost/phpmyadmin 访问 phpMyAdmin,但我收到此错误消息:

I am using XAMPP and I am trying to access phpMyAdmin through http://localhost/phpmyadmin, but I'm getting this error message:

Error
SQL query: 

SHOW PLUGINS

MySQL said: 

#1 - Can't create/write to file '/var/folders/_y/gtpc137d1q9gkvsj0dsxjd040000gn/T/#sql9f2_8_0.MYI' (Errcode: 13)

我有一段时间没有尝试访问它,所以我不知道自上次以来发生了什么变化.任何人都可以为我阐明这一点吗?我在谷歌上搜索过,似乎无法理解大多数人在相关问题中谈论的内容.

I haven't tried to access it in a while so I don't know what has changed since the last time. Can anyone shed light on this for me? I've Googled and can't seem to understand what most people are talking about in related issues.

另外,我的 XAMPP 也不会再连接到 Apache(它只是一直给我加载图像).

Also, my XAMPP won't connect to Apache anymore either (it just keeps giving me the loading image).

这是我得到的错误:

121201 22:59:27 mysqld_safe Starting mysqld daemon with databases from /Applications/XAMPP/xamppfiles/var/mysql
Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored
121201 22:59:28 [Warning] Setting lower_case_table_names=2 because file system for     /Applications/XAMPP/xamppfiles/var/mysql/ is case insensitive
121201 22:59:28 [Note] Plugin 'FEDERATED' is disabled. /Applications/XAMPP/xamppfiles/sbin/mysqld: Can't create/write to file '/var/folders/_y/gtpc137d1q9gkvsj0dsxjd040000gn/T/ibCVKOvf' (Errcode: 13)
121201 22:59:28  InnoDB: Error: unable to create temporary file; errno: 13
121201 22:59:28 [ERROR] Plugin 'InnoDB' init function returned error.
121201 22:59:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121201 22:59:29 [Note] Event Scheduler: Loaded 0 events
121201 22:59:29 [Note] /Applications/XAMPP/xamppfiles/sbin/mysqld: ready for connections.
Version: '5.1.44'  socket: '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock'  port: 3306  Source distribution

推荐答案

日志中的以下一行是原因:

Following line in the log is the reason:

"警告:世界可写的配置文件'/Applications/XAMPP/xamppfiles/etc/my.cnf' 被忽略"

"Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored"

正如 Rishi Kalia 已经指出的那样,您必须设置正确的权限:

As Rishi Kalia has pointed out already you have to set the correct permissions:

  1. 打开终端
  2. 导航到 XAMPP 配置文件夹

  1. Open Terminal
  2. Navigate to the XAMPP config folder

cd/Applications/XAMPP/xamppfiles/etc/

设置my.cnf的权限为600

sudo chmod 600 my.cnf

重启 MySQL.

相关文章