I am not very expert with MySQL and I need some help.
I have a MySQL 5.x database running into a hosting and now I want to bring it to a new instance on my private network. I installed MySQL 8 and use HeidiSQL to export the database from Host targeting to my local instance (running on Windows). It worked perfect. Thanks to the HeidiSQL.
Now I want to create a powershell script to generate a daily mysqldump backup and I have some issues on my script, and I would like to reproduce on the script the exact same
mysqldump command that HeidiSQL does when we export it to a file. I was looking into the github to try to understand the mysqldump part, but I am not sure if I am doing the same thing, since it is not generating the same result.
mysqldump --skip-opt --host=127.0.0.1 --port=3306 --default-character-set=utf8 --user=root --password=***** --protocol=tcp --skip-triggers --skip-extended-insert "my_database_schema" > "2022-10-09-database-backup.sql"
After running this and comparing with what HeidiSQL does, I am getting a script with fine encodings but I have some columns in some tables that are
TEXT data-type and they are not been generated in my script as HeidiSQL does. Another point, I don't know why, but generating from HeidiSQL the final script for my database has a size os
24MB while generating from my
mysqldump statement is
54MB. If I change my column to VARCHAR the scripts generates it perfectly, and I think I am going to do it.
Am I doing something wrong? Can you guys give me some advise? Or even if it is possible to run HeidiSQL from command-line to generate this backup for me?