Site Tools


linux:general:mysql

This is an old revision of the document!


FIXME

MySQL

Install

Configure

Backup and Restore

To rebuild a table by dumping and reloading it, use mysqldump to create a dump file and mysql to reload the file:

mysqldump db_name t1 > dump.sql mysql db_name < dump.sql

To rebuild all the tables in a single database, specify the database name without any following table name:

mysqldump db_name > dump.sql mysql db_name < dump.sql

To rebuild all tables in all databases, use the –all-databases option:

mysqldump –all-databases > dump.sql mysql < dump.sql

Commands

Command Function
mysqldump -
mysqlcheck --repair --databases db_name Repair data types and character sets of a single db changed by updates
mysqlcheck --repair --all-databases Repair data types and character sets of all dbs changed by updates

Troubleshooting

linux/general/mysql.1559823402.txt.gz · Last modified: 2019/06/06 14:16 by lunetikk