Shong asked me how to back up the database, here are 3 ways to back up the database:
(1) Backing Up database files
Each database and datasheet in MySQL corresponds to the directory in the file system and the files under it.
In Linux, the database files are stored in a directory generally/var/lib/mysql. Under Windows This directory depends on the installation path of MySQL, diahosting technicians are generally installed under D:serversoftmysql for customers.
For example, there is a database called BBS, then the BBS database files will be stored in/var/lib/mysql/bbs (Linux) or D:serversoftmysqlbbs (Windows).
Before backing up your files, you need to stop the MySQL service and then copy the database directory.
When you restore a data database, you need to create a database (not necessarily the same name), and then copy the backed-up files (note, not the directory) to the corresponding MySQL database directory.
When you use this method to back up and restore a database, you need to be consistent with the old and new versions of MySQL, or you may get an error.
(2) using command line tools
Back up the database:
Mysqldump–user=root–password=root password –lock-all-tables database name > backup file. sql
To recover a database:
Mysql-u root–password=root Password Database name < backup file. sql
(3) using Web programs
Here we recommend using the "Imperial Backup King" to back up MySQL.
Main advantages:
1, cross platform. Windows and Linux can be run under a variety of web environments.
2, intelligent identification Code, to solve the problem of garbled backup.
3, backup and restore operations can be performed between different versions of MySQL.
4, with a group backup, even more than 1G of the database can be normal backup.
Login "Empire Backup King"
User name: admin
Default password: 123456
The program automatically jumps to the settings page of the database the first time you log on.
For security reasons, be sure to modify the default login password.
If you are recovering on another machine, you will need to upload the "Empire Backup King" program and the directory where the backup data resides in the Bdata directory to the new machine.