Connecting Tech Pros Worldwide Forums | Help | Site Map

MySQL Import: Access denied to database

Newbie
 
Join Date: Jun 2009
Posts: 2
#1: Jun 7 '09
Hi there-

I'm having problems importing a Joomla database to my new server. I've created an empty database on the new server and attached a user with all permissions, but when I hit 'Import' and select the zipped database it gives this error:

#1044 - Access denied for user 'seasonal'@'localhost' to database 'dscharles_IC_20090410_120434'

Does anyone have any ideas what I can do?

Thanks

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#2: Jun 7 '09

re: MySQL Import: Access denied to database


Hi.

You need to give the user access to the database.
This is done using the GRANT command.

Like:
Expand|Select|Wrap|Line Numbers
  1. GRANT
  2.   SELECT, INSERT, UPDATE, CREATE,
  3.   DROP, DELETE
  4. ON 'dscharles_IC_20090410_120434'.*
  5. TO 'seasonal'@'localhost'
  6. IDENTIFIED BY '-InsertPassword-';
This needs to be executed by root, or a user with root-like capabilities.

Also, note that you need to specify any command that the user is allowed to use after the GRANT keyword.
The once I entered are just an example.
You can use the ALL keyword if you want to give the user unrestricted access.

Edit.
Re-reading your post (was kind of distracted the first time around), you say the user already has access?

That can't really be true, seeing as you are getting this error.
If it is, please tell us how you attached the user to the database.
Newbie
 
Join Date: Jun 2009
Posts: 2
#3: Jun 7 '09

re: MySQL Import: Access denied to database


Thanks for replying -

I'm no expert with MySQL and I was doing it all in my host's cpanel
So I went to MySQL Databases, created a new database, created a new user with ALL permissions, then added the user to the database - all from the cpanel MySQL Database program thing...!

Then I tried to do the import and had the error message.

Any ideas?
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#4: Jun 7 '09

re: MySQL Import: Access denied to database


My guess is that your host's cPanel is broken, or that it doesn't create users with proper permissions.

I would contact your host's technical support and ask them about this.

If you actually had root access to the database, this would be as simple as the above example. But since you are using a hosting service, that is highly unlikely.

I've actually had similar problems with my host's cPanel. (It didn't allow users to create MySQL functions)
Their technical support told me this was a deliberate limitation and if I wanted to create functions, I would have to petition them to do it.

Perhaps this is a similar situation.
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 719
#5: Jun 12 '09

re: MySQL Import: Access denied to database


What is the name of new database?
Reply

Tags
access denied, database, import, joomla, mysql