I am trying to automate the mysql dump of all databases with Azure Database for MySQL Server. Current database size:
mysql> SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables GROUP BY table_schema;
+--------------------+---------------+
| DB Name | DB Size in MB |
+--------------------+---------------+
| db1 | 278.3 |
| db2 | 51.8 |
| information_schema | 0.2 |
| mysql | 8.9 |
| performance_schema | 0.0 |
| db3 | 43.3 |
| sys | 0.0 |
+--------------------+---------------+
7 rows in set (31.80 sec)
I have a python script on another virtual machine that calls mysqldumpto upload all of them to a file. However, I ran into a problem with db1. It is flushed to the file, but it is very slow, less than ~ 4 MB in 30 minutes. However, db2they are db3reset almost immediately, in seconds.
I tried all of the following options and combinations to see if the writing speed has changed, but this is not the case:
--compress
--lock-tables (true / false)
--skip-lock-tables
--max-allowed-packet (512M)
--quick
--single-transaction
--opt
Currently, I don’t even use a script, I just run the commands in the shell with the same result.
mysqldump -h <host> -P <port> -u'<user>' -p'<password>' db1 > db1.sql
db1 has ~ 500 tables.
, , db2 db3, , , -, ?
, Google , , , , , db1 , , . 50 , . , Azure , , . , Google Azure .
script, . SQL Server, Azure, mysql, , .