无法通过XAMPP和phpMyAdmin访问MySQL

Mil*_*dia 5 mysql xampp macos phpmyadmin

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

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)
Run Code Online (Sandbox Code Playgroud)

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

此外,我的XAMPP也不再连接到Apache(它只是不断给我加载图像).

这是我得到的错误:

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
Run Code Online (Sandbox Code Playgroud)

dav*_*vid 43

日志中的以下行是原因:

"警告:忽略全局可写配置文件'/Applications/XAMPP/xamppfiles/etc/my.cnf'"

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

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

    cd/Applications/XAMPP/xamppfiles/etc /

  3. 的设置权限my.cnf600

    sudo chmod 600 my.cnf

  4. 重启MySQL.


Ren*_*rry 7

我不得不重置我的xampp文件夹中的权限,因为我需要能够通过我正在构建的网站的php将图像插入到htdocs中的文件夹中.

但是在我改变了我的权限之后:Errcode:13

上面列出的过程有效但我正在为那些不知道如何使用终端的人添加一些额外的注释.

1.打开终端

  • 终端位于 Applications/Utilities/Terminal中

2.导航到XAMPP配置文件夹

  • pwd显示列出当前目录的路径

  • cd更改当前目录

  • ls -a 列出该目录中的所有文件

将此代码输入终端: cd/Applications/XAMPP/xamppfiles/etc /

3.将my.cnf的权限设置为600

在终端输入此代码: sudo chmod 600 my.cnf

4.重启MySQL

瞧!