PDA

View Full Version : troubles with phpmyadmin



no-vice
01-24-2005, 09:40 PM
I am having trouble with phpmyadmin. When I try to go into it, I get the following:
Error

MySQL said:

Access denied for user: 'root@localhost' (Using password: YES)


How can I fix this???

Thanks in advance for any help.

SedroRay
01-25-2005, 06:54 AM
from PHPMyAdmin FAQs:

[2.6] I get an "Access denied for user: 'root@localhost' (Using password: YES)"-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost.

When you are using a port on your localhost, which you redirect via port-forwarding to another host, MySQL is not resolving the localhost as expected.
Erik Wasser explains: The solution is: if your host is "localhost" MySQL (the commandline tool 'mysql' as well) always tries to use the socket connection for speeding up things. And that doesn't work in this configuration with port forwarding.
If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the TCP connection.
this was of no help to me, but may be to you. In my case, I had to creat a separate controluser and controlpass just for PHPMyAdmin:
* The following example assumes you want to use pma as the controluser and pmapass as the controlpass, but this is only an example: use something else in your file!
Of course you have to replace localhost by the webserver's host if it's not the same as the MySQL server's one.

GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
GRANT SELECT (
Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
Execute_priv, Repl_slave_priv, Repl_client_priv
) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'pma'@'localhost';
GRANT SELECT ON mysql.host TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
ON mysql.tables_priv TO 'pma'@'localhost';


If you are using an old MySQL version (below 4.0.2), please replace the first GRANT SELECT query by this one:

GRANT SELECT (
Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
File_priv, Grant_priv, References_priv, Index_priv, Alter_priv
) ON mysql.user TO 'pma'@'localhost';


... and if you want to use the many new relation and bookmark features:

GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';


(this of course requires you to have a special DB for phpMyAdmin, the contents will be explained later)
Of course, the above queries only work if your MySQL version supports the GRANT command. This is the case since 3.22.11.
* Then each of the true users should be granted a set of privileges on a set of particular databases. Normally you shouldn't give global privileges to an ordinary user, unless you understand the impact of those privileges (for example, you are creating a superuser).
For example, to grant the user real_user with all privileges on the database user_base:
GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
What the user may now do is controlled entirely by the MySQL user management system.
With HTTP or cookie authentication mode, you don't need to fill the user/password fields inside the $cfg['Servers'] array.



The GRANT commands should be entered in the mySQL Command Line Client. For me, this only led to a different problem, but maybe (hopefully) it will work for you.