I’m trying to insert a MySQL 5.7 dump into my MySQL 8.04 container. Normally, I run this command: sudo cat file.sql | docker exec -i [container_name] mysql [database] -u[user] -p[password], and it works just fine. However, due to the version difference, I need to run:
SET GLOBAL log_bin_trust_function_creators = 1;
Here’s what I’ve tried so far:
<code>sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench -e "SET GLOBAL log_bin_trust_function_creators = 1;"
sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench <<< "SET GLOBAL log_bin_trust_function_creators = 1;"
</code>
<code>sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench -e "SET GLOBAL log_bin_trust_function_creators = 1;"
sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench <<< "SET GLOBAL log_bin_trust_function_creators = 1;"
</code>
sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench -e "SET GLOBAL log_bin_trust_function_creators = 1;"
sudo cat easy_marine.sql | docker exec -i easy_marine_db_8 mysql easy_marine -uworkbench -pworkbench <<< "SET GLOBAL log_bin_trust_function_creators = 1;"
Each time, the terminal ends instantly as if everything worked fine, but usually, it takes around 10 minutes to complete the dump. And of course, the database was not updated…