遇到的問題
- 騰訊云默認(rèn)3306端口是不開放的需要去安全組->入站規(guī)則開發(fā)端口
- 給mysql開放遠(yuǎn)程鏈接設(shè)置之后蚯窥,需要重啟
vim /etc/mysql/mysql.conf.d/mysqld.cnf
注釋掉 bind-address = 127.0.0.1
進(jìn)入mysql
mysql -u username -p
grant all on *.* to username@'%' identified by 'password';
flush privileges汹忠;
exit;
退出mysql,重啟mysql
sudo /etc/init.d/mysql restart
參考:
https://blog.csdn.net/skh2015java/article/details/80152669
http://www.reibang.com/p/61798dbcef58