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 explains "how to open the remote login account of MySQL database". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to open 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.

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.

How to open the remote login account of MySQL database

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.

Thank you for reading, the above is the content of "how to open the remote login account of MySQL database". After the study of this article, I believe you have a deeper understanding of how to open the remote login account of MySQL database, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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