How to Set up remote login to Mysql database, remote login to mysql database

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.