If mysql sets the external connection to root@%, it cannot be created.

Asked 1 years ago, Updated 1 years ago, 62 views

If you set mysql to externally connectable root@%, you will not be able to create

GRANT ALL PRIVILEGES ON shop.shop TO root@'%' 

Authorization

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO 'root '@'%' identified by 'root'; 

That's it

mysql

2022-09-30 21:48

2 Answers

If you did it exactly as the question said, isn't it because there is an extra half-width between the username and @?

The command you executed:

GRANT ALL PRIVILEGES ON shop.shop TO root@'%' 

Originally to execute commands:

GRANT ALL PRIVILEGES ON shop.shop TO root@'%'

The error message also appears to be playing 'root' with a username that contains spaces as follows:

...TO'root'@'%'


2022-09-30 21:48

If you give me permission later, I can do it

GRANT ALL PRIVILEGES ON shop.shop TO root@'%'
Commands to Execute:

GRANT ALL PRIVILEGES ON shop.shop TO root@'%'


2022-09-30 21:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.