Jump to content

MYSQL DATABASE IMPORT IT OR CREATE IT DIRECTLY IN THE SERVER ?


Ron Wolpa

Recommended Posts

Employing phpmyadmin (wamp) I created locally a db , added a table and some content.
The db has been exported as a dump .sql file.
Then I opened the cpanel > phpmyadmin on server side and tried to import this file with the following result (note .: the db does not exist on server yet) :
Error SQL query: -- Database: `mmKt_aug102013`
CREATE DATABASE IF NOT EXISTS `mmKt_aug102013` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
MySQL said: Documentation
#1044 - Access denied for user 'mmKt'@'localhost' to database 'mmKt_aug102013'

 

 

Reading the error message it makes me think that if the db does not exist on the server , the dump cannot be imported.
Before trying such procedure I had already thought it was necessary to create on server side such db.
By means cpanel > mysql manager , I created a user and added the user to the db.
Then I opened phpmyadmin (server) and tried to import the .sql dump file. I has not worked.
My question is what is the correct procedure to import databases to the server ?
What is the use of cpanel > mysql manager ? (so far I ´ve just employed it to create dbs for wordpress)
Thanks
Link to comment
Share on other sites

It sounds like your host has it set up where you have to create databases in cPanel, the database users do not have CREATE DATABASE privileges. So when you export the database, do not export the entire database where it includes the CREATE DATABASE query, you don't want to create the database with the export. In phpMyAdmin, select your database first and then click on the Export tab. You should see a list of the database tables. Select all of them and export those, just the tables. That will produce a SQL file that contains all of the CREATE TABLE statements, but not the CREATE DATABASE statement.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...