Can't access MySQL through XAMPP and phpMyAdmin

江枫思渺然 提交于 2019-12-02 21:23:45

Following line in the log is the reason:

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

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

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

    cd /Applications/XAMPP/xamppfiles/etc/

  3. Set permissions of my.cnf to 600

    sudo chmod 600 my.cnf

  4. Restart MySQL.

I had to reset the permissions in my xampp folder because I needed to be able to INSERT images into a folder in the htdocs, via php from website I am building.

However after I changed the permission I got : Errcode: 13

The process listed above works but I am adding some additional notes for people who have no clue how to use the terminal.

1. Open Terminal

  • The Terminal is in Applications/Utilities/Terminal

2. Navigate to the XAMPP config folder

  • pwd shows the path listing to the current directory

  • cd changes the current directory

  • ls -a lists all the files in that directory

Enter this code into the terminal: cd /Applications/XAMPP/xamppfiles/etc/

3. Set permissions of my.cnf to 600

Enter this code into the terminal: sudo chmod 600 my.cnf

4. Restart MySQL

Voilà!

you have to go to your xampp installation directory and change the permissions of my.cnf to 600

Sometimes you might have installed an application or a server which accesses the same port which is used by XAMPP. Try changing the port for the XAMPP server. Following link will help you.

http://veerasundar.com/blog/2009/07/how-to-change-xampp-server-port/

If you changed the write and read permissions in all the enclosed items inside the XAMPP main folder ("/Applications/XAMPP"), be sure to make this folder Readable and Writable for everyone: "/Applications/XAMPP/xamppfiles/var/mysql".

This can be done accessing to that folder from the Finder and then Get Info (Cmd + I), in the "Sharing & Permissions" click the lock icon, type your password and change "everyone - read only" to "everyone - read & write", and be sure to make that change for all the enclosed items as well (clicking the gear icon and then "Apply to enclosed items...").

Hope this helps!

user5042118

Pretty simple... once you take ownership of xamppfiles, you also need to update my.cnf file in the xamppfiles/etc/ directory.

Default MySQL password is mysql.

Once you authorized httpd service to run as User yourusername (OS X) Group yourgroup(id).

Open terminal and type in sudo whoami, this will tell you. In the my.cnf file, replace mysql with your user name.

Restart Apache.

Your username.pid file will be automatically updated.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!