Knowledgebase: MySQL
Create a Database from a MySQL Backup
Posted by Cirtex John on 16 May 2008 07:16 PM
First, create the database..

/path/to/bin/mysqladmin -u $mysqlusername -p$mysqlpassword create $mysqldatabasename

Then, add user permission to it..

/path/to/bin/mysqladmin -u usernamehere -ppasshere create databasename

Finally, add the tables back....

/path/to/bin/mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename < backup.sql


mysql -u user -p -e 'source backup_file' database
(782 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
Help Desk Software by Kayako fusion