Today, I tried to use a Windows MYSQL client tool to connect to the MySQL server of the Ubuntu Virtual Machine in VMware and found that I could not connect to the server. Finally, Google found the solution. Here we will share with you.
1.Open Port 3306.
Configure My. CNF
CD/etc/MySQL
Sudo CP my. CNF my. cnf_bak
Sudo Vim my. CNF
Find the following line:
Bind-address = 127.0.0.1
Change 127.0.0.1 to the IP address of the VM (you can use ifconfig to view the IP address ).
Then restart the MySQL server:
Sudo service MySQL restart
2.Enable access permissions for external machines.
This is modified in the MySQL system table as follows:
Use MySQL; Select Host, User , Password From User ; Update User Set Host = ' % ' Where Host = ' Localhost ' And User = ' Root ' ;
For more information, see the followingArticle:
Http://blog.csdn.net/claro/article/details/6240262