Configuring local browser installation for remote MySQL server

72 views
Skip to first unread message

Daniel Caunt

unread,
Jun 26, 2015, 1:30:12 PM6/26/15
to gen...@soe.ucsc.edu
Hi,

I'm configuring a local browser installation and I've run into a
problem while trying to modify the location of the MySQL server. I
have already compiled the executables for a local MySQL installation
and it worked fine. However, when I change the db.host variable in
www/cgi-bin/hg.conf to a remote hostname and recompile I get the
following error when browsing to Genomes on our site
(cgi-bin/hgGateway)

"Couldn't connect to database hgcentral on localhost as readwrite.
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)"

So, it looks like it's still trying to connect to a local MySQL
instance (which I have since disabled in favor of the remote
instance). I can see that hgGateway has a new timestamp, so I know
that the compilation at least created new files.

Do I need to modify anything other than db.host in hg.conf? (like db.socket)

Any help is appreciated.

Thanks.
Dan

Matthew Speir

unread,
Jun 30, 2015, 12:03:50 PM6/30/15
to Daniel Caunt, gen...@soe.ucsc.edu
Hi Daniel,

Thank you for your question about setting up a mirror of the UCSC Genome
Browser. One of our engineers notes:

If your other mysql instance is still on the same server, my guess
would be that you need to change
the socket setting in file my.cnf, which is usually in the etc
folder. Ensure that it is correctly
configured with:

socket=/var/lib/mysql/mysql.sock

but put the correct path in for the mysql server you want to use.

I hope this is helpful. If you have any further questions, please reply
to gen...@soe.ucsc.edu. All messages sent to that address are archived
on a publicly-accessible Google Groups forum. If your question includes
sensitive data, you may send it instead to genom...@soe.ucsc.edu.

Matthew Speir
UCSC Genome Bioinformatics Group

Daniel Caunt

unread,
Jun 30, 2015, 4:07:29 PM6/30/15
to gen...@soe.ucsc.edu
Hi Matthew,

Thanks for the response but in this case the other mysql instance is
not on the same machine. It is on a different machine on the same
network. I have set that machine's name in www/cgi-bin/hg.conf using
the db.host variable and then recompiled, but the error "Couldn't
connect to database hgcentral on localhost as readwrite. Can't
connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)" indicates to me that it is ignoring
my db.host setting and still trying to connect to a local mysql
instance.

Can you tell me if I need to do anything other than set db.host in
www/cgi-bin/hg.conf and recompile in order to change the location of
the mysql server? Is there anything else I can try in order to
troubleshoot this further?

Thanks.
Dan

Hiram Clawson

unread,
Jun 30, 2015, 4:15:46 PM6/30/15
to Daniel Caunt, gen...@soe.ucsc.edu
Good Afternoon Daniel:

The hgcentral database connection settings are a different set
of settings in the hg.conf file. Your error message says 'localhost'
which is the default setting for:

central.db=hgcentral
central.host=localhost
central.user=readwrite
central.password=update
central.domain=mylab.university.edu

Try changing these hg.conf settings.

--Hiram

Daniel Caunt

unread,
Jul 1, 2015, 12:21:37 PM7/1/15
to Hiram Clawson, gen...@soe.ucsc.edu
Hiram,

Thanks so much! That did it. I simply missed those variables further
down the hg.conf file. Thank you for reminding me about them.

Kind regards,
Dan
Reply all
Reply to author
Forward
0 new messages