Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

1044 - Access denied for user 'user'@'localhost' to database 'db'

I tried a lot to import the sql script to create database and tables through phpmyadmin in the new site I hosted. But i'm getting the error,

1044 - Access denied for user 'user'@'localhost' to database 'db'

I tried to create a sample db directly : create database sampled; I'm getting the same access denied error.

I'm not able to grant privileges to the user also, i'm getting the same access denied error.

Following is the output of show grants command,

show grants;
GRANT USAGE ON . TO 'someuser'@'localhost' IDENTIFIED BY PASSWORD 'somepw' 

GRANT ALL PRIVILEGES ON someuser\_%.* TO 'someuser'@'localhost' 

Any help would be appreciated. thank you.

like image 292
user3141777 Avatar asked Jan 30 '14 04:01

user3141777


People also ask

How to fix error 1044 in MySQL?

Edit the MySQL options file (typically /etc/my. cnf on Linux systems). Add the option to disable enforcement. This should go anywhere below the [mysqld] option group in the option file.


1 Answers

If you are using Godaddy then don't directly go to phpMyAdmin and run the sql command.

You have to go to MySQL® Databases section and create a database there. Then create a user and give it the permission to access the database you just created. Now you can go to phpMyAdmin and write your SQL commands.

Hope this helps

like image 145
5511002233 Avatar answered Oct 18 '22 19:10

5511002233