一、 sudo apt-get updatemysql
二、 sudo apt-get install mysql-server mysql-clientsql
三、 安裝過程當中,輸入root的密碼兩次數據庫
四、 sudo service mysql restart查看是否安裝成功ide
五、 設置運行遠程訪問:rest
a> 註釋修改配置文件 /etc/mysql/my.cnf 中 bind_ip/bind-address行server
b> mysql -u root -p 登入ip
c> create database test; 建立數據庫get
d> use mysql;it
e>grant all privileges on *.* to username@"%" identified by "password" with grant option; #受權用戶username經過密碼password在任何地址訪問任何庫。io
f> exit 退出登入
g> sudo service mysql restart; 重啓mysql服務
h> 在遠程進行訪問。