Error executing GRANT statement: ERROR 1064

Asked 2 years ago, Updated 2 years ago, 37 views

SQL statement

grant all privileges on*.* to test_user1@"%" identified by 'test1234' with grant option;

error message

ERROR1064

There seems to be an error in SQL grammar. What's the difference?

mysql

2022-09-30 19:19

1 Answers

I think you're probably trying to create a user, but to create a user, use create user instead of grant.The grant is used to grant permissions to the created user.

In previous versions of MySQL, users were also created with grant, but in recent versions, errors occurred.

I think you can do the following.

create user test_user1@'%' identified by'test1234';
grant all on*.* to test_user1@'%' with grant option;


2022-09-30 19:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.