webdork
asked on
Manage MySQL via SSH
I'm trying to boost the max_allowed_packet in mySQL. I can connect via SSH and change to root user. I've written the change to my.cnf, but I do not know the correct syntax to restart mysqld.
typing service mysqld restart in SSH returns "service command not found".
typing service mysqld restart in SSH returns "service command not found".
ASKER
typing /sbin/service mysld restart
returns mysld unrecognized seervice
returns mysld unrecognized seervice
ASKER
service
Yup, typo.
/sbin/service mysqld restart
/sbin/service mysqld restart
ASKER
Tried that.
root@ip-xx.xx.xxx.xxx [/home/xxxxxxx]# /sbin/service mysqld restart
mysqld: unrecognized service
root@ip-xx.xx.xxx.xxx [/home/xxxxxxx]# /sbin/service mysqld restart
mysqld: unrecognized service
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cent OS 5
ASKER
root@ip-xx-xx-xxx-xxx [/home/xxxxxxxx]# sudo/etc/init.d mysqld restart
bash: sudo/etc/init.d: No such file or directory
bash: sudo/etc/init.d: No such file or directory
OK, so service is available. What's the output of the ps command?
Tested on Centos 6 and these both work:
/sbin/service mysqld restart
/etc/init.d/mysqld restart
/sbin/service mysqld restart
/etc/init.d/mysqld restart
ASKER
root@ip-xxxxxx [/home/xxxx]# ps
PID TTY TIME CMD
15818 pts/0 00:00:00 su
15823 pts/0 00:00:00 bash
16024 pts/0 00:00:00 ps
PID TTY TIME CMD
15818 pts/0 00:00:00 su
15823 pts/0 00:00:00 bash
16024 pts/0 00:00:00 ps
ps -aux | grep mysql
ASKER
verbatim give bad syntax:
root@ip-xxxxxxxxxxx [/home/xxxxxxxxxx]# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2. 7/FAQ
root@ip-xxxxxxxxxxx [/home/xxxxxxxxxx]# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.
ps aux | grep mysql
It should list 3 processes containing "mysql".
It should work with the -, even with the warning...
It should list 3 processes containing "mysql".
It should work with the -, even with the warning...
ASKER
here is the return from typing: ps aux | grep mysql
root@ip-xxxxxxxxxx [/home/xxxxxxxxx]# ps aux | grep mysql
root 3622 0.0 0.0 2564 1188 ? S Apr15 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/my sql --pid-file=/var/lib/mysql/ ip-xxxxxxx ip.secures erver.net. pid
mysql 3725 0.0 2.1 331908 69116 ? Sl Apr15 1:07 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib /mysql --plugin-dir=/usr/lib/mysq l/plugin --user=mysql --log-error=/var/lib/mysql /ip-xxxxxx xx.ip.secu reserver. net.err --pid-file=/var/lib/mysql/ ip-5xxxxxx xxxxx.ip.s ecureserve r.net.pid
root 16066 0.0 0.0 1952 560 pts/0 S+ 09:51 0:00 grep mysql
root@ip-xxxxxxxxxx [/home/xxxxxxxxx]# ps aux | grep mysql
root 3622 0.0 0.0 2564 1188 ? S Apr15 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/my sql --pid-file=/var/lib/mysql/
mysql 3725 0.0 2.1 331908 69116 ? Sl Apr15 1:07 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib /mysql --plugin-dir=/usr/lib/mysq
root 16066 0.0 0.0 1952 560 pts/0 S+ 09:51 0:00 grep mysql
OK. So the mysqld daemon is named "mysqld" and is running.
What's the output of
/etc/init.d/mysqld restart
What's the output of
/etc/init.d/mysqld restart
ASKER
root@ip-xxxxxxxxxxx [/home/xxxxxxxxxxx]# /etc/init.d/mysqld restart
bash: /etc/init.d/mysqld: No such file or directory
bash: /etc/init.d/mysqld: No such file or directory
Then I don't understand. I don't have a CentOS 5 box to test on, but the same commands apply since CentOS 4 so it should work.
The exception is if you or someone else manually compiled MySQL and did not create the start/stop/restart scripts, but I don't think that's the case.
You can do it the hard way, by killing processes with pid 3622 and 3725 and then running:
The exception is if you or someone else manually compiled MySQL and did not create the start/stop/restart scripts, but I don't think that's the case.
You can do it the hard way, by killing processes with pid 3622 and 3725 and then running:
/bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/ip-xxxxxxxip.secureserver.net.pid
but that will cause problems, as the pid file will still exist after a dirty exit and you might lose uncommitted transactions.
ASKER
I got the answer from the server tech support in about 10 seconds (below). The last tech support guy said "gee we cant help you with that" - go figure.
I'll certainly give you credit for the solution.
root@ip-xxxxxxxxxxxxx [~]# service mysql restart
Shutting down MySQL.... SUCCESS!
Starting MySQL.. SUCCESS!
root@ip-xxxxxxxxxxxxxxx [~]#
I'll certainly give you credit for the solution.
root@ip-xxxxxxxxxxxxx [~]# service mysql restart
Shutting down MySQL.... SUCCESS!
Starting MySQL.. SUCCESS!
root@ip-xxxxxxxxxxxxxxx [~]#
They renamed the service name from mysqld to mysql... Why?
ASKER
My best experience in 5 years with EE.
Quick with advice
Stayed engaged
Put up with my frustation
Quick with advice
Stayed engaged
Put up with my frustation
Glad I could help!
PS: I own a small support company so I know a bit about frustrated clients :)
PS: I own a small support company so I know a bit about frustrated clients :)
Type /sbin/service mysld restart
HTH,
Dan