0

I need to import a sql. database to Wordpress through phpMyAdmin. Anytime I want to create a new database this error happens (#1044 - Access denied for user 'xxx' to database 'zzz').

Thanks for your help.

mia11
  • 1
  • Is it hosted locally or on a shared hosting ? If it is on a shared-hosting check user privileges (Give it permission to access the database). Here is an article for Cpanel : https://www.hostgator.com/help/article/how-do-i-create-a-mysql-database-a-user-and-then-delete-if-needed . – Ion T Sep 12 '22 at 11:01

2 Answers2

0

You can check all privileges permission of database user and also check our sql file. May be mention there "CAEATE DATABASE '*******'" if you have that then you remove that. Most of this #1044 refer you to check your database user and permission of your database. I think this suggestion will help you.

Anjan
  • 104
  • 6
0

As the others have mentioned, shared hosting environments generally don't allow you to create any arbitrary database name, sometimes you're limited to only one database and sometimes it has to be a subset of your username or something. If that's the case, you'll need to edit the .sql file to force it to use the database name you've been assigned.

If that's not the case, it's likely the user you are logged in as doesn't have the privileges to create a new database, so you'll need to log in as a user that does have privileges. Perhaps you're not logged in as the user you think you are. Note that the username and host value need to match, otherwise you could be logged in as the anonymous user instead of one that has permissions (for instance, if your user account is mia with host field 127.0.0.1 but you're logged in via the socket connection to 'localhost', it doesn't match.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43