소켓파일이 삭제 되어서 로컬 접속이 안 되는 경우
mysqladmin -u root -p --protocol=tcp shutdown
또는
mysqladmin -u root -p -h 127.0.0.1 shutdown
다음의 결과에 따라서 시작/종료 명령을 다르게 한다.
[root@mmysql init.d]# ls -al /etc/init.d/mysql*
-rwxr-xr-x 1 root root 6839 May 25 2016 /etc/init.d/mysqld
시작/종료
service mysqld start service mysqld stop service mysqld status service mysqld restart
mysqld_safe --skip-grant-tables & |
자동 시작
[root@mmysql ~]# chkconfig --add mysqld [root@mmysql ~]# chkconfig mysql on
[root@mmysql init.d]# chkconfig --list mysqld mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
|
[root@mysqlent5 ~]# ls -al /etc/init.d/mysql*
-rwxr-xr-x 1 root root 8156 Aug 25 10:09 /etc/init.d/mysql-monitor-agent
-rwxr-xr-x 1 root root 10975 Aug 24 16:49 /etc/init.d/mysql.server
시작/종료
/etc/init.d/mysql.server start /etc/init.d/mysql.server restart /etc/init.d/mysql.server stop |
자동 시작
[root@mysqlent5 ~]# cp /etc/init.d/mysql.server /etc/init.d/mysql [root@mysqlent5 ~]# chmod +x /etc/init.d/mysql [root@mysqlent5 ~]# chkconfig --add mysql [root@mysqlent5 ~]# chkconfig mysql on [root@mysqlent5 ~]# chkconfig --list mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
chkconfig가 없는 경우 수동 설정 방법
[root@mysqlent5 ~]# cp /etc/init.d/mysql.server /etc/init.d/mysql [root@mysqlent5 ~]# chmod +x /etc/init.d/mysql [root@mysqlent5 ~]# cd /etc/rc.d/rc3.d [root@mysqlent5 ~]# ln -s /etc/init.d/mysql S99mysql |