Mysql – Cannot connect to theSQL because of invalid settings

MySQLpassworduser-accountsxampp

I'm new to xampp, and have it installed on a Windows 7 machine. Earlier, I was able to at least get the login page for phpMyAdmin, but it was not taking username of "root" and no password, so I changed the username and password in the config.inc.php file, but now I don't even get the login page.

This is the message I get: "phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."

Also, I changed the config.inc.php.safe file to have the same settings, and took the comment off of the "bind-address="127.0.0.1" in the my.ini file.

I want to make sure that the way I have my virtual host in httpd-vhosts.conf is not the problem (I don't know enough about it to tell):

NameVirtualHost *
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName mygrafica.com
<Directory "C:\xampp\htdocs\mygrafica.com">
Order allow,deny
Allow from all
</Directory>

Thanks in advance!!!

Best Answer

You need not change bind-address, since all this lives on the same box.

What you DO need, however, is mysqld listening on port 3306 on localhost, and a user that phpmyadmin can use to log on.

The first can be checked with netstat -an, look for port 3306.

The second is a bit more involved and requires you to log on to mysql first:

mysql -u root -p root_password

This will require a GRANT for that user, something like:

mysql > GRANT ALL ON *.* TO 'phpmyadmin'@'127.0.0.1' IDENTIFIED BY 'some_password';

And configure phpmyadmin to use those credentials.