BlackFire27
BlackFire27

Reputation: 1550

phpmyadmin cant select data from tables

I got this error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)'

Then I went to phpmyadmin and found this:

#1142 - SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs' 

How do I get rid of that error? is it something with permissions..please help

I tried this..didnt work:

GRANT SELECT ON database.* TO user@'localhost' IDENTIFIED BY 'password';

Here is in codeIgniter:

> $db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';

I tried to change the password in my.ini :

CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';

didnt work

Upvotes: 1

Views: 4609

Answers (1)

000
000

Reputation: 3950

It looks you are mixing a couple of things:

GRANT SELECT ON database.* TO user@'localhost' IDENTIFIED BY 'password';

here above the user is user while in your codeIgniter(CI) coed it is $db['default']['username'] = 'root'; user root

Even if you want to keep the same CI code then you need to specify password for user root which currently you are giving blank $db['default']['password'] = '';

Upvotes: 2

Related Questions