I've followed the tutorial here and set up a ProxySQL v2.0.2 service on an Ubuntu AWS EC2 instance.
One thing that troubles me is that the configurations of ProxySQL are gone after the EC2 instance restarts.
For example, before the EC2 instance restarted, SELECT * FROM mysql_servers;
returns the backend databases I've added to ProxySQL. But after the EC2 restarted, SELECT * FROM mysql_servers;
returns an empty set. And I must re-configure ProxySQL to allow the clients to connect to databases through ProxySQL.
How can I preserve the ProxySQL configurations after the EC2 instance restarts?
Why can't SAVE MYSQL VARIABLES TO DISK;
command preserve the configurations?
I configure ProxySQL using the admin interface
.
I've tried adding servers in mysql_users
section of /etc/proxysql.cnf
file. But it seems that it has no effect at all. This is strange.
According to this document, I should use SAVE MYSQL SERVERS TO DISK
to save the mysql_servers
configuration to the disk.
SAVE MYSQL VARIABLES TO DISK;
is used to save other variables to the disk.