sudo apt-get install mysql-server mysql-client
記得root密碼別忘了。
sudo service mysql restart
/etc/MySQL/my.cnf找到bind-address = 127.0.0.1,注釋掉
打開/etc/mysql/my.cnf,在[mysqld]後添加character-set-server=utf8
mysql -u root -p ->GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; ->FLUSH PRIVILEGES;
重啟mysql服務即可生效!