Friday, November 15, 2024

terminal – Modifying MySQL Workbench connections from the command line with MySQL Workbench on OSX

I’m trying to automate some MySQL Workbench connection creation/modification from a bash (or NodeJS) script running on OSX. However, whenever I update the connections.xml file and the Keychain access entry, then open the connection details in Workbench, it just reverts the connections.xml file back to what it was before.

I have full access to OSX Keychain Access, and I can see/update/create the keys in there just fine. I can also see the connections in the MySQL workbench connections file (~/Library/Application Support/MySQL/Workbench/connections.xml).

I’m trying to update the username and password for a connection to a specified server, but when I update it in the connections.xml and OSX Keychain, it doesn’t actually change it in the MySQL workbench UI. Moreover, when I close out of the connection details for that server, it automatically reverts the connections.xml file back to what it was before.

I’ve been looking around in the Python scripts in the MySQL/Workbench directory and it looks like it creates a temporary file, but I can’t find where that file is located at. I’m also not sure if updating that would work either (I have a feeling it might just crash Workbench).

Related Articles

Latest Articles