Preface When using the MySQL database, sometimes the client needs to log in to the server's database directly remotely instead of sending the request to the database server. At this time, you need to configure the remote access permissions of MySQL. The specific configuration method is also very simple. You can find a lot of tutorials on how to configure remote login to the MySQL database by searching any search engine. step The steps introduced online are basically divided into two steps: Modify the my.cnf configuration file The mysql configuration file is usually in /etc/mysql/my.cnf. Open it to view its configuration. There is such a section: # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1 This bind-address is to bind the IP, which means that only the local machine is allowed to log in by default. In order to achieve remote login, this sentence obviously needs to be commented out. After modification, restart the mysql service. Add User Permissions As needed, set the corresponding permissions for the specified user and IP mysql>GRANT ALL PRIVILEGES ON AB TO 'user'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES Here, all permissions on table B in database A are granted to the user from any host ('%') who logs in with password 'password'. Or directly modify the user table in the MySQL database to meet the requirements. The above is what you need to do in theory, but I did it and still couldn't connect. After a lot of trouble, I finally found out that the server provider had imposed additional restrictions on the opening of ports in order to ensure the security of the server. For example, Tencent server sets up a security group, which additionally restricts the open ports. By default, the MySQL port 3306 is prohibited from being opened. Therefore, you need to open the console and configure the permissions: The rest are default, just add the second to last line. . . Summarize The above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: js to call the network camera and handle common errors
>>: Detailed explanation of docker entrypoint file
In HTML, common URLs are represented in a variety ...
This article uses examples to describe how to bac...
<a href="https://www.jb51.net/" titl...
<div class="sideBar"> <div>...
Application example website http://www.uhuigou.net...
The scroll-view of WeChat applet has more bugs wh...
The first step is to install TypeScript globally ...
Table of contents Preface difficulty Cross-domain...
Docker Features 1) Quick to get started It only t...
1. Setting case sensitivity of fields in the tabl...
Vue card flip carousel display, while switching d...
This is the installation tutorial of mysql5.7.18....
This article mainly introduces the breadcrumb fun...
Table of contents introduce Object attributes in ...
Table of contents Problem Description Rendering T...