In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, there is a mysql database on the server, remote access, do not want to publish the root account, so, created a demo account, allowing the demo account to access the shandong library in the mysql database anywhere.
Option 1:
Run on the machine where mysql is installed:
1: create a user user
The copy code is as follows:
CREATE USER demo IDENTIFIED BY "123456"
2 、
The copy code is as follows:
Mysql > GRANT ALL PRIVILEGES ON shandong.* TO 'demo'@'%'WITH GRANT OPTION
/ / give any host permission to access data, or you can do the following
GRANT ALL PRIVILEGES ON shandong.* TO 'demo'@'%'IDENTIFIED BY' 123456 'WITH GRANT OPTION
3 、
The copy code is as follows:
Mysql > FLUSH PRIVILEGES
/ / the modification takes effect
4 、
The copy code is as follows:
Mysql > EXIT
/ / log out of the MySQL server so that you can log in as demo on any other host
Quote
In addition, when using the client to connect to the mysql, it is found that the connection cannot be made, and it seems that the user needs to be reauthorized. Do the following:
[root@cicro108 mysql] # bin/mysql-uroot-p-h 127.0.0.1-A cws3
Enter password:
Welcome to the MySQL monitor. Commands end with or / g.
Your MySQL connection id is 1863 to server version: 4.1.20-standard
Type 'help;' or' / h' for help. Type'/ c'to clear the buffer.
Mysql > grant ALL PRIVILEGES ON *. * to root@ "%" identified by "mysql"
Query OK, 0 rows affected (0.17 sec)
It is found that after changing the permissions in this way, the remote still cannot connect, but you can use the following actions.
Mysql > grant ALL PRIVILEGES ON *. * to root@ "%" identified by "mysql" WITH GRANT OPTION
Query OK, 0 rows affected (0.17 sec)
At this point, root can be connected remotely, but other non-root users can also connect remotely here.
Option 2:
MySQL 1130 error Resolution:
This error occurs when connecting to MySQL through MySQL-Front or MySQL administrator
ERROR 1130: Host *. * is not allowed to connect to this MySQL server
Indicates that the connected user account does not have the permission to connect remotely and can only log in on the local machine (localhost).
You need to change the host entry in the user table in the MySQL database
Rename localhost%
Specific steps: log in to MySQL
First of all, use MySQL
An error occurred when update in the way provided by others.
MySQL > update user set host='%' where user = 'root'
ERROR 1062 (23000): Duplicate entry'%-root' for key 'PRIMARY'
Then check the host information of the following database as follows:
MySQL > select host from user where user = 'root'
+-- +
| | host |
+-- +
| |% |
| | 127.0.0.1 | |
| | localhost.localdomain |
+-- +
3 rows in set (0.00 sec)
Host already has the% value, so run the command directly:
The copy code is as follows:
MySQL > flush privileges
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.