Passionate about technologies, innovations.

mySQL: Error 1045

If you get this error (in phpMyAdmin or other operation) after setting up a MySQL password:

ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

This might caused by phpMyAdmin's configuration doesn't have the new password. If using XAMPP, you need to update the /Applications/xampp/xamppfiles/phpmyadmin/ for the phpMyAdmin:

$cfg['Servers'][$i]['password'] = 'YOURPASSWORD';

Change the YOURPASSWORD to the password you set before.

Also the /Applications/xampp/etc/my.cnf should be updated accordingly. The configration file specifies mysql's setting. So dig in the file and update the settings:

# The following options will be passed to all MySQL clients
password    = YOURPASSWORD
port        = 3306
socket      = /Applications/xampp/xamppfiles/var/mysql/mysql.sock

Same here update the password.

Although setting up securities for local development is a little hassle as you need to type in password etc etc, I still recommend to set it properly.