Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to open the remote login account of MySQL database

2025-04-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to open the remote login account of MySQL database". In the daily operation, I believe that many people have doubts about how to open the remote login account of MySQL database. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to open the remote login account of MySQL database". Next, please follow the editor to study!

In the work practice and study, how to open the remote login account of MySQL database is a difficult problem. The following are the two major steps summarized in the work and practice, which can help DBA to successfully complete the remote login account of MySQL database.

1. Make sure that the firewall on the server does not block port 3306

The default port of MySQL is 3306. You need to make sure that the firewall does not block port 3306, otherwise the remote cannot connect to MySQL through port 3306.

If you specified a different port when you installed MySQL, open the port number you specified for MySQL in the firewall.

If you don't know how to set up a firewall on your server, consult your server administrator.

2. Add allowing remote connection and authorization of MySQL users

1) first log in to MySQL with your root account

Click the start menu in the Windows host, run, type "cmd", enter the console, MySQL's bin directory, and enter the following command.

Enter the following command at the command prompt on the Linux host.

> MySQL-uroot-p123456

CODE: [COPY]

> MySQL-uroot-p123456

123456 is the password of the root user.

How to open the remote login account of MySQL database

2) create a remote login user and authorize

> grantallPRIVILEGESondiscuz.*toted@'123.123.123.123'identifiedby'123456'

The above statement authorizes all permissions of the discuz database to the user ted, allows the ted user to log in remotely at the IP of 123.123.123.123, and sets the password of the ted user to 123456.

Let's analyze all the parameters one by one:

AllPRIVILEGES means to grant all permissions to the specified user, which can also be replaced with a specific permission, such as select,insert,update,delete,create,drop, which is separated by a "," comma.

Discuz.* indicates which table the above permissions are for, discuz refers to the database, and the following * means for all tables, it can be inferred that the authorization for all tables in all databases is "*. *", for all tables in a database is "database name. *", and for a table in a database is "database name. table name".

Ted indicates which user you want to authorize, either an existing user or a non-existent user.

123.123.123.123 indicates the IP address that allows remote connections. If you want to not limit the IP of the link, set it to "%".

123456 is the user's password.

After executing the above statement, then execute the following statement before it can take effect immediately.

> flushprivileges

At this point, the study on "how to open the remote login account of MySQL database" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report