MySQL4の起動と停止
MySQL4の起動と停止
0.改訂履歴
1.はじめに
このドキュメントでは,MySQLのサーバを起動したり停止したりする手順を説明する. なお,MySQLはVer4.1を使っている.
2.MySQLを起動する
[root@uranos www]# ps -ef | grep mysql
root 10688 22423 0 20:28 pts/1 00:00:00 grep mysql
[root@uranos www]#
|
- 今回は,mysqld_safeコマンドを使って起動する.
- まずはコマンドを探す.
[root@uranos www]# locate mysqld_safe
/usr/share/man/man1/mysqld_safe.1.gz
/usr/bin/mysqld_safe
[root@uranos www]#
|
[root@uranos www]# /usr/bin/mysqld_safe &
[1] 10731
Starting mysqld daemon with databases from /var/lib/mysql
[root@uranos www]#
|
[root@uranos www]# ps -ef | grep mysqld
root 10731 22423 0 20:33 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 10746 10731 0 20:33 pts/1 00:00:00 /usr/sbin/mysqld --
basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib
/mysql/uranos.pid --skip-locking
root 10756 22423 0 20:33 pts/1 00:00:00 grep mysqld
[root@uranos www]#
|
[shinnai@uranos shinnai]$ ps -ef | grep mysqld
root 10870 22423 0 21:41 pts/1 00:00:00 /bin/sh /usr/bin/my
sqld_safe
mysql 10885 10870 0 21:41 pts/1 00:00:00 /usr/sbin/mysqld --
basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/
mysql/uranos.pid --skip-locking
shinnai 10895 22374 0 21:42 pts/2 00:00:00 grep mysqld
[shinnai@uranos shinnai]$
|
- 現在稼働していることが確認できる.
- mysqladminコマンドを探す.
[root@uranos www]# locate mysqladmin
/usr/share/man/man1/mysqladmin.1.gz
/usr/bin/mysqladmin
[root@uranos www]#
|
- mysqladminコマンドで,MySQLデーモンをシャットダウンする.
[root@uranos www]# /usr/bin/mysqladmin shutdown -u root -p
Enter password: ■■■■■■■■■■■
[root@uranos www]#
|
[root@uranos www]# ps -ef | grep mysql
root 10688 22423 0 20:28 pts/1 00:00:00 grep mysql
[root@uranos www]#
|