-
Notifications
You must be signed in to change notification settings - Fork 0
MySQL Troubleshooting
Ben Buie edited this page Mar 30, 2020
·
2 revisions
##Helpful Commands
-
Example of exporting table
mysqldump -u INSERT_USERNAME -p -h INSERT_HOST -P INSERT_PORT --set-gtid-purged=OFF INSERT_DATABASE_NAME INSERT_TABLE_NAME > tableexport.sql
-
Example of exporting database
mysqldump -u INSERT_USERNAME -p -h INSERT_HOST -P INSERT_PORT --set-gtid-purged=OFF --databases INSERT_DATABASE_NAME > dbexport.sql
If for any reason you need to restore you can use the the below
-
Example of restoring table
mysql -u INSERT_USERNAME -p -h INSERT_HOST -P INSERT_PORT INSERT_DATABASE_NAME < tableexport.sql
-
Example of restoring database
mysql -u INSERT_USERNAME -p -h INSERT_HOST -P INSERT_PORT < dbexport.sql