Workbench and MySQL server at non-standard location in Linux.

Recently I had to test MySQL Workbench against fresh version of the server. Naturally, the default mysql-server was already installed from repository of my Linux distro. So I installed the latest server version into my /opt/server directory. And then I had several points to resolve, for example, how to start detached server process from Workbench Adminstrator; how to detect if the server is running or not, given that there are many of them running; how to stop the server.

Now I will show several workarounds to perform tasks listed in the previous paragraph. Below are the commands I put into Server Instance Editor, there are corresponding text entries labeled: ‘Start MySQL’, ‘Stop MySQL’, ‘Check MySQL Status’:

Staring server – (nohup /opt/server/5.5.9/bin/mysql_safe –defaults-file=/opt/server/5.5.9/my.cnf & disown %1)
Note! the command above must be used including parentheses
Stopping server – kill `cat /opt/server/5.5.9/mysql.pid`
Note! the command contains backticks
Checking MySQL Status – ps ax | wba_filter(/opt/server/5.5.9/my.cnf

Also I had to tweak /opt/server/5.5.9/my.cnf, here is the content of the file:
[mysqld]
port = 3308
basedir = /opt/server/5.5.8
datadir = /opt/server/5.5.8/data
tmpdir = /opt/server/5.5.8

socket = /opt/server/5.5.8/mysql.sock
pid-file = /opt/server/5.5.8/mysql.pid
log-error = /opt/server/5.5.8/mysql.error.log

That is all I had to change to make the server installed in custom location work from WBA.

One thought on “Workbench and MySQL server at non-standard location in Linux.”

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.