ubunto16.04 mysql安裝 遠程連接配置

sudo apt-get update
sudo apt-get install mysql-server
//進入數據庫
mysql -u root -p
//數據庫配置
use mysql;
update user set host = '%' where user = 'root';
grant all privileges on *.* to 'root'@'%' identified by '#####';
flush privileges;
quit;
//修改ip限制
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
//註釋或者改ip
bind-address=127.0.0.1 ----->bind-address=0.0.0.0
//保存退出
//重啓
sudo service mysql restart

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章