Web Hosting Talk







View Full Version : Server Restart changes MySQL to default Settings


BMM
01-10-2003, 06:04 PM
We have a server with a database that is used pretty heavily. In order to prevent "There are too many database connections open." messages from occurring we have had to change the defualt MySQL settings for max_connections and wait_timeout.

The MySQL settings for max_connections and wait_timeout revert back to the default settings when the server is restarted. We are looking for an explaination for why the MySQL settings are reverting back to the default settings when the server is restarted?

We have tried to modify etc/my.cnf but this has resulted in MySQL being completely down(it will not even restart). Obviously we are doing something wrong. Please help.

We are running RH 7.2 with Plesk

dandanfirema
01-10-2003, 07:27 PM
what is the syntax for what you attempted to add to the my.cnf file?

BMM
01-10-2003, 08:17 PM
Originally posted by dandanfirema
what is the syntax for what you attempted to add to the my.cnf file?


Here is what we added:

[mysqld]
bind-address=127.0.0.1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable max_connections = 500
set-variable wait_time = 300

[mysql.server]
user=mysql
basedir=/var/lib/

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Here is what was there before the modification:
[mysqld]
bind-address=127.0.0.1

dandanfirema
01-11-2003, 12:15 AM
What error message do you get? check /var/log/messages

BMM
01-11-2003, 06:27 AM
Originally posted by dandanfirema
What error message do you get? check /var/log/messages


Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/httpd/vhosts/domainname.com/httpdocs/forums/index.php on line 38

This is the error message that we received when trying to view a .php page on the site.

dandanfirema
01-11-2003, 09:16 AM
Check /var/log/messages

rcs
01-11-2003, 11:02 AM
Originally posted by BMM

set-variable max_connections = 500
set-variable wait_time = 300


The above is wrong :cool:

you need:
set-variable=max_connections=500
set-variable=wait_timeout=300


HTH.

BMM
01-11-2003, 01:42 PM
Originally posted by rcs


The above is wrong :cool:

you need:
set-variable=max_connections=500
set-variable=wait_timeout=300


HTH.

Thanks rcs! That was the problem. MySQL restarts just fine with the my.cnf file modified.