I need a mechanism where i can dump the mysql which is running as a pod in the EKS cluster. By main use case is the the dump i can share to my development team so that they can restore the dump in their local(normal mysql running as service). I have seen Velero, Portworx but they only restore/dump within cluster(k8) not useful for me if a developer wants to restore in local. Also i worked using normal mysqldump/mysql with kind schedulerjob/cronjob but in my db their are UUID using where when it is getting converted to "null" value . Any help would be highly appreciated as it is pulling my head from last week.
-
1`but in my db their are UUID using where when it is getting converted to "null" value` what does this line means and what exactly are you expecting? – gohm'c Oct 20 '21 at 05:40
-
ok, there is a a field in my db table with uuid name format(binary). while trying to export using mysqldump it is getting converted to text and while restoring the value gets to null. – Jithin Kumar S Oct 20 '21 at 05:51
-
Basically you have binary columns in the database? Have you tried to use `--hex-blob` option to export binary as hex (makes the exported file bigger BUT more reliable) ? – AndD Oct 20 '21 at 06:15
-
what's the size of the database you want to dump? – gohm'c Oct 20 '21 at 06:19
-
comes almost 45-50 MB only. – Jithin Kumar S Oct 20 '21 at 06:20
1 Answers
You can try out the
mysqldump --user=root --port=3306 --password=topsecret --hex-blob some_database
--hex-blob : Dump binary columns using hexadecimal notation
Doc : https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option_mysqldump_hex-blob
Just to add, you can also run UI of Adminer to export the data instead of using command to container.
OR
Copying the entire data folder
If you are copying the entire database, all of the databases and the contents of the database, you can just zip up your entire MySQL data directory, and copy it to the new server Pod's data directory.
This is way to copy InnoDB files from one instance to another. This will work fine if you're moving between servers running the same OS family and the same version of MySQL
https://dev.mysql.com/doc/refman/8.0/en/server-options.html#option_mysqld_datadir

- 27,020
- 6
- 48
- 102