Server leasing talk about MySQL How to turn on remote login function

Source: Internet
Author: User
Tags hosting server hosting

Server Leasing talk about How MySQL can turn on remote login function

do the site, to update the database frequently, contact with the database is certainly MySQL. Sometimes when the station is built because the database and the website are placed in different IP, this time need to use the program for MySQL remote connection, and MySQL because of the security factors, the default is that the user can not connect remotely, only local connection, this time you need to modify the settings. Here is a small part of the introduction of the Operation method.

Enter cmd command mode.
mysql-h localhost-u mysql-p
Enter Password: ******

connect to the database.
mysql> use MySQL; ( This DB holds Various configuration information for MySQL)
Database changed
Mysql> select Host,user from user; ( View user's permissions )
+-------------+-------+
| Host | user |
+-------------+-------+
| localhost | |
| localhost | Root |
| localhost | |
| localhost | MySQL |
+-------------+-------+
6 rows in Set (0.02 sec)
as you can see, you can only access it as a host of localhost.
mysql> Grant All privileges on * * to ' root ' @ '% ' identified by ' password ' with Grant option;
(% indicates that all external machines, if specified a machine, will be changed to the corresponding machine name;' root ' means the user name to be used, the Password need to change The password to root)
mysql> flush Privileges; ( Run as a sentence to take effect, or restart MySQL)
Query OK, 0 rows affected (0.03 sec)
Mysql> select Host,user from user; ( See the user's permissions again )
+-------------+-------+
| Host | user |
+-------------+-------+
| % | mysql |
| % | root |
| localhost | |
| localhost | Root |
| localhost | |
| localhost | MySQL |
+-------------+-------+
Mysql>exit
now try again: from the remote cmd to see if you can log in, can log in, the general code is also can be connected to.

Tip : In addition to note that the User Rights table is the DB table in the MySQL database , which details which users have permissions to which several databases have permission to operate, This is more important for multi-user management.

Hengyang High-protection server rental , server hosting, large bandwidth rental of enclosures

Hengyang Machine Room export 500G , 30g--200g High Defense,

Open UDP Open the Port Ignore Cc/udp/syn Attack!

New configuration Dell R610 , eight-core 16 threads

Hunan IDC Room High anti-high with Baidu IP segment Dell brand Server

G Port Access  ! Stable! High-protection! Second Solution! Real Defense!

7*24*365 hours after-sales operation and maintenance technical support

Xiao Xin Reed : 2851506992 Reed 604906005 tell:15013023312

Server Leasing|Server Hosting|Hengyang Server Rental|Hengyang Server Hosting|Game Server Rental|high-protection server rental|Renting a server|Managed Server|Server Leasing|high-protection server|Web Server Leasing|Dual-line server leasing|Hunan Double Line|Hengyang Double Line high anti-

Hengyang Machine Room IP segment:

124.228.91.*

220.170.92.*

220.169.89.*

Baidu section: 59.51.81.*

Server leasing talk about MySQL How to turn on remote login function

Related Article

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.