Mysql client navicat connects to the database
Description of experimental environment:
Install vmware workstaion 11 on the local physical machine windows7 system, create a new centos6.6 system virtual machine and install LAMP environment;
Local physical IP: 192.168.71.123 Virtual machine IP address: 192.168.71.126
Objective:
Access mysql database in virtual machine in local windows;(it can be used by development department after test OK)
The specific steps are as follows:
1. Virtual machine settings: Virtual network editor selects bridging mode and bridges to the local NIC;
Virtual machine network connection: bridge mode, copy physical machine network status check;
2. Log in to the virtual machine, modify the virtual machine NIC settings, change the IP to 192.168.71.126, and the gateway to 192.168.71.1, restart the NIC service;ping the physical machine local IP 192.168.71.123 can be pinged, indicating network interoperability (the physical machine needs to close the local firewall)
3. Log in to the virtual machine database and authorize new users and passwords to access it;
Example: Authorize all libraries and tables without restricting sources;
mysql> grant all on *.* to 'yong'@'%' identified by 'yong';
mysql> flush privileges;
In the actual production environment, authorization can be added, deleted and searched, and the database to be accessed is specified, the user and the user source IP are specified, and the use is restricted;
mysql> grant select,delete,update,create,insert on zabbix.* to 'test'@'192.168.71.123' identified by 'test123';
mysql> flush privileges;
In the virtual machine local can test, can log in;
[root@localhost ~]# mysql -utest -ptest123 -h292.168.71.126
4, Windows local installation mysql client software navicat;
After installation, create a new connection, fill in the database ip address, username and password, save, test whether the connection is OK.
After successful connection into the database, you can query;