To completely copy MySQL data files, you must ensure that MySQL has no write operations. The common practice is to create a table. If there are many tables
The operation is not convenient. the most convenient way is to change the connected database account to a read-only operation. After the file is copied, it can be written again.
In this way, users can browse the website normally without stopping services.
All permissions:
Grant all privileges on *. * To 'username' @ '% 'identified by 'userpassword ';
Flush privileges;
Read-Only permission:
Grant select on *. * To 'username' @ '%' identified by 'userpassword ';
Flush privileges;
Bytes --------------------------------------------------------------------------------------------------------
Note that the data cannot be imported immediately after the preceding method is set. Otherwise, the database file may be damaged.
We strongly recommend that you:
Flush tables with read lock;
Export files
Unlock tables;