技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁(yè) > 教程 > 服務(wù)器類 >

linux下Mysql的啟動(dòng)關(guān)閉的命令

來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2018-04-30 00:04┆點(diǎn)擊:

[root@lnmp ~]# /usr/local/mysql/bin/mysql --version
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.3-m13, for Linux (x86_64) using  EditLine wrapper
[root@lnmp ~]# /bin/cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld    #將mysql.server拷貝到啟動(dòng)項(xiàng)
[root@lnmp ~]# /etc/init.d/mysqld start    #啟動(dòng)MYSQL數(shù)據(jù)庫(kù)
Starting MySQL.... SUCCESS! 
[root@lnmp ~]# netstat -tunlp|grep 3306    #查看是否開啟了mysql數(shù)據(jù)庫(kù)端口3306
tcp        0      0 :::3306                     :::*                        LISTEN      1773/mysqld         
[root@lnmp ~]# /etc/init.d/mysqld stop    #停止mysql數(shù)據(jù)庫(kù)
Shutting down MySQL.. SUCCESS! 
[root@lnmp ~]# netstat -tunlp|grep 3306    #查看是否關(guān)閉了mysql的默認(rèn)端口3306
[root@lnmp ~]#

備注:你可以將/usr/local/mysql/bin加入PATH中。這樣可以直接輸入mysql或者mysqladmin,不用輸入全路徑。