2

enter image description hereI'm beginner python code, and not good at english.

my laptop window 10 pro, python version 3.6 mysql commmunity server version 8.0.12

problem

headfirst python

this is the code

mysql -u root -p
mysql>create database vsearchlogDB;
mysql>grant all on vsearchlogDB.* to 'vsearch' identified by 'vsearchpasswd';

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'vsearchpasswd'' at line 1

1
  • create user vsearchlogDB identified by 'vsearchpasswd'; not just create vsearchlogDB; Commented Oct 1, 2018 at 8:30

2 Answers 2

2

it should be grant all privileges, not just all the username should also have the host pointer like `vserach'@'%'

grant all privileges on vsearchlogDB.* to 'vsearch'@'%' identified by 'vsearchpasswd';

is more like it

EDIT: I'm blind and totally ignored the "8.0" part. On 8.0 this should look like:

create user 'vsearch'@'%' identified by 'vsearchpasswd';
grant all privileges on vsearchlogDB.* to 'vsearch'@'%'; //(Don't forget the ';')
Sign up to request clarification or add additional context in comments.

1 Comment

same error occurred ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'vsearchpasswd'' at line 1
1

Please try this code:

create user 'vsearch' identified by 'vsearchpasswd';

grant all on vsearchlogDB.* to vsearch;

1 Comment

How is this better than the previous answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.