restore_mysql_database_from_the_command_line
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| restore_mysql_database_from_the_command_line [2016/07/24 16:17] – walkeradmin | restore_mysql_database_from_the_command_line [2017/05/21 18:29] (current) – walkeradmin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| + | <color red>Last time I tried this it failed, I had to do this:</ | ||
| + | \\ | ||
| + | \\ | ||
| + | |||
| + | ---- | ||
| + | **USE THIS METHOD NOW** | ||
| + | ---- | ||
| + | |||
| + | sudo mysql -u root -p<color red> | ||
| + | \\ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | \\ | ||
| + | |||
| + | ---- | ||
| + | OLD METHOD | ||
| + | ---- | ||
| + | |||
| From the command line: | From the command line: | ||
| + | \\ | ||
| + | First you must login to MySQL | ||
| + | \\ | ||
| + | mysql -u root -p — (the root part assumes root is your mysql username) | ||
| + | \\ | ||
| + | To restore a database, use the following command: | ||
| \\ | \\ | ||
| mysql database_name < database_name.sql | mysql database_name < database_name.sql | ||
| Line 14: | Line 39: | ||
| If you are trying to restore a single database from dump of all the databases, you have to let mysql know like this: | If you are trying to restore a single database from dump of all the databases, you have to let mysql know like this: | ||
| \\ | \\ | ||
| - | mysql --one-database database_name < all_databases.sql | + | |
| \\ | \\ | ||
restore_mysql_database_from_the_command_line.1469377078.txt.gz · Last modified: (external edit)
