mysql.sock problem

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

mysql.sock problem

Postby jcandali » Fri Apr 10, 2009 4:46 pm

Hi,

I recently relocated the MySQL database that rsyslog talks to to a larger filesystem. Afterwards rsyslog complained that it could not connect to the database via /var/lib/mysql/mysql.sock. This is understandable since that file has been moved elsewhere. I updated the my.cnf file to tell it where the new socket file is but as far as I know this is just for MySQL. Is there a way to specify an alternate socket file location for rsyslog to talk to?

Thanks.

--James
jcandali
New
 
Posts: 3
Joined: Wed Jan 21, 2009 6:47 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: mysql.sock problem

Postby rgerhards » Tue Apr 14, 2009 9:19 am

I am far from being a MySQL expert, so I didn't even know such an option exists. Can you point me to the doc, I'll then possibly be able to find what needs to be done in the API to support it.

Thanks,
Rainer
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: mysql.sock problem

Postby jcandali » Wed Apr 15, 2009 5:03 pm

When MySQL is compiled, there is an option to specify where the unix socket is kept as well as where the datafiles (indices, data and format files) live. If, throughout the life of the database, these need to be moved, you can specify in a config file the new location. Here's an example of a modified /etc/my.cnf file:

--------------------------------------------------------------------------------------------------------------------
[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
datadir=/new/path/to/mysql
socket=/new/path/to/mysql.sock

# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib/
basedir=/new/base/dir


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[client]
socket=/new/path/to/mysql.sock
--------------------------------------------------------------------------------------------------------------------

The portions in red are the lines I changed from the default to accommodate the new database home. Really all that would be needed is a way to specify an alternate location for the socket file. Perhaps in the "$ModLoad ommysql" line. I'm not entirely sure how rsyslog does it currently. I believe (though I may be mistaken) that when MySQL support is compiled in it takes the location from the mysql_version.h header file. This is the only place that I can find, so far, that specifies the default location for the socket file unless rsyslog somehow queries the running mysqld for this information though I'm not entirely sure how it would do that but I digress...

MySQL Documentation:

Using MySQL Option Files: http://dev.mysql.com/doc/refman/5.1/en/ ... files.html
MySQL Options: http://dev.mysql.com/doc/refman/5.1/en/ ... tions.html

I hope that helps. If not, let me know if you need more information and I'll see what I can do.
jcandali
New
 
Posts: 3
Joined: Wed Jan 21, 2009 6:47 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron