Reputation: 3
I'm developing a web site that is based around a MySQL db. Because I wanted to do it off-line first, I installed WAMP server on my machine. This has Apache, an SQL server, and PHP.
I created a database on my off-line machine. The database is calledOffDB
, created by user OffUser
, with password OffPwd
. I have exported it to an SQL file (less than one MB).
I want to import this db into my online db, which is called OnDB
, created by user OnUser
, with password OnUser
. When I try to import in PHPMyAdmin, I get the following error:
"User OnUser doesn't have permissions to access databse OffDB"
In the off-line PHPMyAdmin, I added a new user, OnUser
, with password OnPwd
, and granted it all permissions to OffDB. Then I exported OffDB again, and atempted to import again. It failed with the same error. Same thing if I add new off-line user OnUser, with password OffPwd, and grant it permission - upon import I always get the error.
How can I solve that?
Upvotes: 0
Views: 3471
Reputation: 980
You need to add the OffUser and OffDB to the live server, not the other way around.
Alternatively, make a backup that does not specify the database name and users (for the latter, look for options involving GRANTs, and disable those). mysqldump
should have options for that, at least if you use the mysqldump <database_name>
variant, as should PHPMyAdmin.
Upvotes: 1