Your database changes should always be via migrations.
What scenario requires you to take the development database and overwrite production?
What is the prefered options of syncing a local MySQL db with the production one that sits on a shared hosting? We are using GIT, ssh and Composer to sync the framework, but the MySQL sync is a bit of a pain. Currently, we are using PHPMyAdmin to manually export on the dev machine and drop and import on a live hosting account. How can this be automated so that we don't have that brief downtime while syncing. Both the dev and the hosting machines are running Linux.
The shared hosting allows remote MySQL connections and has all the bash goodies as well. Is mysqldump in combination with scp and ssh the way to go?
You could write a bash script that generates a dump, transfers it to the production server, and imports it. But you can't restore a dump without any downtime.
You could develop directly on the production DB by connecting the dev app to it via an SSH tunnel. You'd get rid of downtime that way, but I wouldn't recommend it. If you goof something up, it's immediately felt in production.
Replication is used to keep multiple production databases in sync in real time, but it's not feasible here. Unless the dev app runs on its own server, so you can maintain a persistent connection with TLS.
I can't recommend a good solution because this isn't how live databases are designed to operate. I guess a script to automate the import is the least crazy option.
Please or to participate in this conversation.