I want to create a new user in mysql with syntax:
create user \'demo\'@\'localhost\' identified by \'password\';
But it returns an error: <
I had the same Problem and the Answer is just Right in front of you, remember when you ran the script while installing mysql like
sudo mysql_secure_installation
there somewhere you chose which password type would you like to chose
There are three levels of password validation policy:
LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:
you have to give a password to same policy
here are some sample examples for your passwords:
for type 0: abcdabcd
for type 1: abcd1234
for type 2: ancd@1234