Page 1 of 1

service mysqld restart breaking mysql

Posted: Fri Jul 15, 2005 6:44 am
by EvolutionCrazy
Today i've upgraded from 3.23 to ART 4.0.24 on a RH 3ES

It's working good... execpt that everytime i do:

a
service httpd restart

or a
/etc/rc.d/init.d/mysqld restart

the service apparently is correctly restarting... on:
/var/log/messages
i got:
Jul 15 12:34:57 plesk mysqld: Stopping MySQL: succeeded
Jul 15 12:34:57 plesk mysqld: Starting MySQL: succeeded

but after the restart the mysql server isn't no more accesible...
from php:
15 Jul 2005 12:35:12 - MySQL error - 2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
the same error appear if i try to access using mysqlclient:
mysql -uadmin -p`cat /etc/psa/.psa.shadow`

how can i fix this?

is there a way to be able to restart mysql without rebooting the server?

in /etc/var/log/mysqld.log

i can see:
A mysqld process already exists at Fri Jul 15 12:03:48 CEST 2005
my.conf
[mysqld]
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=100
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=50
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
thread_concurrency=2
myisam_sort_buffer_size=16M
log-bin
server-id=1

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

[safe_mysqld]

err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

[client]
socket=/var/lib/mysql/mysql.sock

Posted: Fri Jul 15, 2005 7:31 am
by scott
try running it twice, if its a busy db it might not be completing a shutdown before trying to start again

Posted: Fri Jul 15, 2005 7:39 am
by EvolutionCrazy
yeah :D

the problem was the it wasn't stopping...

i've tried:

service mysqld stop

wait 20sec

service mysqld start

and it came back..

i've found this thread:
http://forum.plesk.com/showthread.php?postid=66869

so i've added "sleep 10s" and now i can restart it ;)
restart(){
stop
sleep 10s
start
}

thanks scott ;)