linux下Mysql的啟動關閉的命令

來源:互聯網
上載者:User

 下面我來為各位介紹linux下Mysql的啟動關閉的命令,有需要瞭解的朋友不防進入看看吧.

  

linux下Mysql的啟動關閉(本文基於centos6.4、mysql5.7.3),mysql安裝在/usr/local/mysql目錄下:

[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拷貝到啟動項
[root@lnmp ~]# /etc/init.d/mysqld start    #啟動MYSQL資料庫
Starting MySQL.... SUCCESS! 
[root@lnmp ~]# netstat -tunlp|grep 3306    #查看是否開啟了mysql資料庫連接埠3306
tcp        0      0 :::3306                     :::*                        LISTEN      1773/mysqld         
[root@lnmp ~]# /etc/init.d/mysqld stop    #停止mysql資料庫
Shutting down MySQL.. SUCCESS! 
[root@lnmp ~]# netstat -tunlp|grep 3306    #查看是否關閉了mysql的預設連接埠3306
[root@lnmp ~]#

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.