XAMPP - SELECT command denied to user ''@'localhost' for table 'users'

19,723

Solution 1

The user has not been given privileges to read the tables.

When creating an user for the database through the cpanel of your host, you can give the user the privileges.

Or read this documentation to do it through MySql command,

http://dev.mysql.com/doc/refman/5.1/en/grant.html

Solution 2

you can solve through Enabling the use of SELECT

GRANT SELECT ON db.table TO 'user'@'localhost';

or

Grant all on db.table to 'user'@'localhost';

Share:
19,723
Jake McLaughlin
Author by

Jake McLaughlin

Updated on June 04, 2022

Comments

  • Jake McLaughlin
    Jake McLaughlin almost 2 years

    Awhile back I deleted and messed around with some functions in XAMPP.

    I reinstalled it and moved/renamed my folder with all my other files so I now have a new xampp directory that's empty and fresh.

    But when I try to use any database functionality it gives me error(s) like the one below:

    SELECT command denied to user ''@'localhost' for table 'users'
    

    What's wrong?

    Thanks.