1.Ubuntu下MySQL 安裝
sudo apt-get install mysql-server mysql-client
安裝完後,彈出軟件包設置對話框,設置密碼,切記記住密碼!!mysql
2.驗證Mysql安裝
sudo service mysql restart
3.登陸MYSQL
mysql -u root -p
輸入密碼便可登陸sql
4.設置Mysql遠程IP訪問
/etc/MySQL/my.cnf找到bind-address = 127.0.0.1,註釋掉spa
5.設置字符集、排序規則等。
打開/etc/mysql/my.cnf,在[mysqld]後添加character-set-server=utf8rest
6.設置root遠程訪問
mysql -u root -p ->GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; ->FLUSH PRIVILEGES;
重啓mysql服務便可生效!code
sudo service mysql restart