Hedi
Hedi

Reputation: 322

Grant user access denied in mysql

i have connected to server with my workbench , and see all databases on it , but i cant see its tables.

could not be fetched

hence i have logged in mysql server by root user and create a new user in user table in mysql database , after granting access to this user i get following error :

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

how can solve this problem?

this is my root user informations :

Host: 127.0.0.1

          User: root
          Password: 
          Select_priv: Y
          Insert_priv: Y
          Update_priv: Y
          Delete_priv: Y
          Create_priv: Y
            Drop_priv: Y
          Reload_priv: Y
        Shutdown_priv: Y
         Process_priv: Y
            File_priv: Y
           Grant_priv: Y
      References_priv: Y
           Index_priv: Y
           Alter_priv: Y
         Show_db_priv: Y
           Super_priv: Y
Create_tmp_table_priv: Y
     Lock_tables_priv: Y
         Execute_priv: Y
      Repl_slave_priv: Y
     Repl_client_priv: Y
     Create_view_priv: Y
       Show_view_priv: Y
  Create_routine_priv: Y
   Alter_routine_priv: Y
     Create_user_priv: Y
           Event_priv: Y
         Trigger_priv: Y
             ssl_type: 
           ssl_cipher: 
          x509_issuer: 
         x509_subject: 
        max_questions: 0
          max_updates: 0
      max_connections: 0
 max_user_connections: 0

Upvotes: 0

Views: 155

Answers (2)

Zahid Ali
Zahid Ali

Reputation: 466

Most Of the time this error occurs due to connection problem where either user name or password went wrong in the connection object and we starts assuming that we don`t have enough privileges, so first of all please make sure that your connection objects has valid user name and password

Upvotes: 0

Helping Hands
Helping Hands

Reputation: 5396

You will need to grant that user to perform actions , Please use below query :

GRANT INSERT, SELECT, DELETE, UPDATE ON database.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Upvotes: 1

Related Questions