Mysql non standard port

Forum for questions and support relating to the 1.24.x releases only.
Locked
xmasin
Posts: 14
Joined: Wed Mar 16, 2011 9:36 am

Mysql non standard port

Post by xmasin »

I need to run two mysql programs in one computer and I'd like to ask, if is it possible to tell zoneminder, that mysql database is using different port insteand of standard port 3306.
chippy
Posts: 7
Joined: Wed May 18, 2011 8:31 pm

Re: Mysql non standard port

Post by chippy »

Not sure if this will work but you could try putting the port number after the host name in zm.conf so you would have something like
ZM_DB_HOST=localhost:3305
User avatar
andrewa
Posts: 18
Joined: Tue Feb 15, 2011 7:22 pm
Location: Bulgaria

Re: Mysql non standard port

Post by andrewa »

It does not work for me this way. I stopped zm and mysqld, chaneged in my.cnf port = 3307, started mysqld, changed in zm.conf ZM_DB_HOST=localhost:3307, started zm and got FAILED. Log file says:
Sep 5 10:47:22 skladr zmpkg[8871]: INF [Command: start]
Sep 5 10:47:22 skladr zmfix[8883]: ERR [Can't connect to server: Unknown MySQL server host 'localhost:3307' (3)]
Sep 5 10:47:22 skladr zmpkg[8871]: ERR [Unable to run "sudo -u apache /usr/bin/zmfix", output is ""]
With the standard mysql port 3306 everything works OK.
I added PORT statement after HOST statement in zm.conf:
ZM_DB_HOST=localhost
ZM_DB_PORT=3307
started zm. got OK and it worked!
Better include this info in the doc file, changing MySQL default port is a useful option.
Locked