In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about how to open remote connection permissions in MySQL. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
1. Log in to MySQL database
Mysql-u root-p
View the user table
Mysql > use mysql;Database changedmysql > select host,user,password from user +-+ | host | user | password | +- -- + | localhost | root | * A731AEBFB621E354CD41BAF207D884A609E81F5E | | 192.168.1.1 | root | * A731AEBFB621E354CD41BAF207D884A609E81F5E | +-- -+ 2 rows in set (0.00 sec)
You can see the root users that have been created in the user table. The host field indicates the host logged in, and its value can be either IP or hostname
(1) sometimes if you want to log in with a local IP, you can change the above host value to your own Ip.
2. Realize remote connection (authorization law)
Changing the value of the host field to% means that you can log in to the mysql server as a root user on any client machine, and it is recommended to set it to% at development time.
Update user set host ='% 'where user =' root'
Change permissions to ALL PRIVILEGES
Mysql > use mysql;Database changedmysql > grant all privileges on *. * to root@'%' identified by "password"; Query OK, 0 rows affected (0.00 sec) mysql > flush privileges;Query OK, 0 rows affected (0.00 sec) mysql > select host,user,password from user +-+ | host | user | password | +- -- + | localhost | root | * A731AEBFB621E354CD41BAF207D884A609E81F5E | | 192.168.1.1 | root | * A731AEBFB621E354CD41BAF207D884A609E81F5E | |% | root | * A731AEBFB621E354CD41BAF207D884A609E81F5E | +- -+ 3 rows in set (0.00 sec)
In this way, the machine can remotely access the MySql on the machine with the user name root password root.
3. Realize remote connection (table change method)
Use mysql
Update user set host ='% 'where user =' root'
In this way, you can access Mysql through root users at the remote end.
4. If the above method does not work
It may be caused by the access to port 3306 restricted by the corresponding server. Take Tencent Cloud as an example:
This is how to enable remote connection permissions in the MySQL shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.