Ubuntu安裝MySQL

來源:互聯網
上載者:User

標籤:

使用Ubuntu10.04LTS安裝MySQL步驟如下:

1.安裝資料庫:sudo apt-get install mysql-server

安裝過程中需要設定密碼。

2.安裝用戶端:sudo apt-get install mysql-client

3.登入MySQL:mysql -u root -p

4.設定檔:/etc/mysql/my.cnf

a.設定遠端存取:將bind-address = 127.0.0.1中的127.0.0.1給為本機IP,這樣能夠使資料庫支援網路遠端存取。設定完成後,重啟mysql服務:service mysql restart

b.資料庫開啟/關閉/重啟等:/etc/init.d/mysql [start|stop|restart|reload|force-reload|status]

5.退出資料庫:exit

6.卸載MySQL:

a.刪除 mysql

1 sudo apt-get autoremove --purge mysql-server
2 sudo apt-get remove mysql-server
3 sudo apt-get autoremove mysql-server
4 sudo apt-get remove mysql-common (非常重要)

上面的其實有一些是多餘的,建議還是按照順序執行一遍
b.清理殘留資料
dpkg -l |grep ^rc|awk ‘{print $2}‘ |sudo xargs dpkg -P

Ubuntu安裝MySQL

聯繫我們

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