How to Set up remote login to Mysql database, remote login to mysql database
You can access the MySQL of another machine on one machine, but some settings are required.
After entering MySQL, enter the following command:
Grant all privileges on *. * TO 'tigase '@' % 'identified by '000000' with grant option;
Allow any host to use tigase as the user name (root users cannot log on remotely, but only local users can log on), and 123456 as the password to access MySQL.
Flush privileges;
Let MySQL reload the permission so that the granted permission can take effect immediately.
How can I configure the mysql database as a remote access type?
The premise is that you have correctly installed the mysql database.
Then Port 3306 is enabled in the firewall, that is, port 3306 is added to the "exception ".
Now, you can remotely access mysql by using the navicat client.
How PHP remotely connects to the MySQL database
Configure this in your project. For example, if I use the thinkphp framework, there is a line in the configuration file: 'db _ host' => 'localhost'. The database server to be accessed is configured here, I use localhost locally. If you use localhost on the server, you can write the website address or IP address of your server. Any php framework or non-framework has such a setting.