檢測本機是否有安裝mysql
sudo netstat -tap | grep mysql
執行上面的命令之後,看到 mysq 的socket 處於監聽狀態,說明有安裝成功。
安裝mysql
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4NCjxwPjxjb2RlIGNsYXNzPQ=="hljs 1c">安裝過程中會提示輸入數據庫管理員密碼(自己設定的),如圖
設置完成之後等待安裝完成即可。
mysql 的登陸與退出
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.5.43-0ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit;
Bye