Backup and Restore MySQL DB




Note the Following :

1. Commands mentioned below should be executed from command prompt and not from MYSql prompt.

 

How to create a Backup SQL file

1. Open windows command prompt.

2. Change directory to : C:\Program Files\MySQL\MySQL Server 8.0\bin (This is the standard part where MYsql is installed)

3. Run the following Command

mysqldump.exe –e --column-statistics=0 –u[username] -p[password] -h[hostname] [database name] > C:\[filename].sql

 

How to Restore Backup from SQL File

1. Open windows command prompt.

2. Change directory to : C:\Program Files\MySQL\MySQL Server 8.0\bin (This is the standard part where MYsql is installed)

3. Run the following Command

 

mysql –u[user name] -p[password] -h[hostname] [database name] < C:\[filename].sql

 

How to create a Backup SQL Table

mysqldump.exe –e --column-statistics=0 –u[username] -p[password] -h[hostname] [database name] [table name] > C:\[filename].sql

 




Reference

Documentation Reference

https://blog.winhost.com/using-mysqldump-to-backup-and-restore-your-mysql-databasetables/

https://serverfault.com/questions/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109




Private

This area is only for registered user. Please register.