Friends who often use php+mysql are generally managed by phpMyAdmin to manage the database. Some daily debugging development work, the use of phpMyAdmin is really convenient. But when we need to export hundreds of trillion or even a few g of the database, phpMyAdmin will be very card. Even if you want to import large amounts of data, phpMyAdmin is completely unable to complete. Because phpMyAdmin is based on a PHP Web page, it is not possible to upload too large SQL files. In fact, MySQL official gave us a good solution: mysqldump.
Here's how to export a database in a Windows environment using mysqldump:
Find your MySQL installation directory, which is the directory where Mysqldump.exe resides. For example, the path on my computer:
In the space, hold down the SHIFT key and right-click and select Open Command Line window here.
After you start the command line, enter
Mysqldump-h localhost-u Root "database user name"-p--opt--default-character-set=utf8--hex-blob icenter "database name to export"-- Skip-triggers > D:/icenter.sql "Export Path"
After executing the above command, you can export the SQL file. No matter how large your database is, you can export it using this method.
The command to import the database is as follows:
Mysql-h localhost-u rufavor-p Icenter < D:/icenter.sql
The Run method is similar to the above export. Similarly, in a Linux environment, you can also use mysqldump to export imported data.
Original address: MySQL import and export a large amount of data, backup recovery method
MySQL import and export a large amount of data, backup recovery method