一、linux下查看mysql服務(wù)的兩種方法:
1.[root@localhostbin]ps -ef|grepmysql
2.[root@localhostbin]netstat -nlp
二、linux下啟動mysql服務(wù)的兩種方法
1.命令行方式:
[root@localhostbin]cd /usr/bin
[root@localhostbin]./mysqld_safe &
systemctl start mysqld.service
2.服務(wù)方式:
[root@localhost~]service mysql start
systemctl start mysqld.service
如果服務(wù)在啟動狀態(tài),直接重啟服務(wù)用以下命令:
[root@localhost~]service mysql restart
systemctl restart mysqld.service
三、linux下關(guān)閉mysql服務(wù)的兩種方法:
命令行方式:
[root@localhost~]mysqladmin -u rootshutdown
服務(wù)方式:
[root@localhost~]service mysql stop
systemctl stop mysqld.service