First, create the database..
How can I create a database from an sql backup file ?
/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
OR:
mysql -u user -p -e 'source backup_file' database
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment