ubuntu 14.04下安裝mysql 5.5

來源:互聯網
上載者:User

標籤:linux

1.ubuntu下安裝mysql需要一些命令(1)sudo apt-get install mysql-server安裝過程中會出現如下視窗,需要使用者輸入相關的資料庫密碼:

(2)sudo apt-get isntall mysql-client
(3)sudo apt-get install libmysqlclient-dev安裝完成之後,可以用下面的命令檢查是否安裝成功 sudo netstat -tap | grep mysql

通過上述命令檢查之後,如果看到有mysql 的socket處於 listen 狀態則表示安裝成功。 tcp        0      0 localhost:mysql         *:*                     LISTEN      28385/mysqld  

2.登陸mysql可以輸入如下命令:mysql -u root -p

show databases;show tables;


3.補充一些安裝過程中的小知識 1. 刪除mysql

a. sudo apt-get autoremove --purge mysql-server-5.0
b. sudo apt-get remove mysql-server
c. sudo apt-get autoremove mysql-server
d. sudo apt-get remove mysql-common (非常重要)上面的其實有一些是多餘的,建議還是按照順序執行一遍

2. 清理殘留資料dpkg -l |grep ^rc|awk‘{print $2}‘ |sudoxargs dpkg -P
3.ubuntu下啟動/停止/重啟 mysql   3.1使用service:
   sudo service mysql stop   sudo service mysql start   sudo service mysql restart


   3.2使用 mysqld 指令碼啟動

    sudo /etc/init.d/mysql stop

    sudo /etc/init.d/mysql start

    sudo /etc/init.d/mysql restart

重啟提示錯誤如下:Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql start...其實已經告訴怎麼做了:用sudo service mysql start啟動即可





 

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

ubuntu 14.04下安裝mysql 5.5

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.