In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to enable remote access in MYSQL. The editor thinks it is practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
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'; above is how to enable remote access in MYSQL. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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: 291
*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.