How to Fix ProxySQL Configuration When it Won’t Start

How to Fix ProxySQL Configuration When it Won’t Start

PREVIOUS POST
NEXT POST

restart ProxySQL configWith the exception of the three configuration variables described here, ProxySQL will only parse the configuration files the first time it is started, or if the proxysql.db file is missing for some other reason.

If we want to change any of this data we need to do so via ProxySQL’s admin interface and then save them to disk. That’s fine if ProxySQL is running, but what if it won’t start because of these values?

For example, perhaps we accidentally configured ProxySQL to run on port 3306 and restarted it, but there’s already a production MySQL instance running on this port. ProxySQL won’t start, so we can’t edit the value that way:

We could delete proxysql.db and have it reload the configuration files, but that would mean any changes we didn’t mirror into the configuration files will be lost.

Another option is to edit ProxySQL’s database file using sqlite3:

Or if we have a few edits to make we may prefer to do so with a text editor:

The above commands will dump the global_variables table into a file in SQL format, which we can then edit:

Now we need to restore this data. We’ll use the restore command to empty the table (as we’re restoring from a missing backup):

Once we’ve made the change, we should be able to start ProxySQL again:

While you are here

You might enjoy my recent post Using ProxySQL to connect to IPV6-only databases over IPV4

You can download ProxySQL from Percona repositories, and you might also want to check out our recorded webinars that feature ProxySQL too.

PREVIOUS POST
NEXT POST

Share this post

Comment (1)

Leave a Reply