讓虛擬機中的MySQL能夠被主機訪問

一、VirtualBox對Ubuntu系統進行設置,「網絡」選擇「橋接網卡」mysql

 

二、安裝MYSQL服務器sql

sudo su;   apt-get intall mysql-server服務器

 

三、賦予遠程訪問的權限:網絡

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option; ide

flush privileges;server

 

四、修改綁定地址get

vi /etc/mysql/mysql.conf.d/mysql.cnf, 把bind-address=127.0.0.1改爲bind-address=0.0.0.0it

 

五、重啓MYSQL服務器io

/etc/init.d/mysql stop;權限

/etc/init.d/mysql start;

相關文章
相關標籤/搜索