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 17:17] โ walkeradmin | restore_mysql_database_from_the_command_line [2023/03/09 22:35] (current) โ external edit 127.0.0.1 | ||
---|---|---|---|
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: 2023/03/09 22:35 (external edit)