0

I am running mysql server on my ubuntu machine,

I created a database using the following line of code:

CREATE DATABASE Quizzie;

Now , I want to grant permission to users in this database, so I used the following line of code.

GRANT ALL ON Quizzie.* TO 'user'@'localost' IDENTIFIED BY 'user';
GRANT ALL ON Quizzie.* TO 'user'@'127.0.0.1' IDENTIFIED BY 'user';

But I get following errors:

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 'Abhilekh'' at line 1
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
IcanCode
  • 509
  • 3
  • 16
  • No I haven't created a user – IcanCode Sep 13 '21 at 15:52
  • 2
    MySQL 8.0 changed the syntax for creating users and running grants. If you are following instructions written for earlier versions of MySQL, you should read the [current manual on Account Management Statements in MySQL 8.0](https://dev.mysql.com/doc/refman/8.0/en/account-management-statements.html). – Bill Karwin Sep 13 '21 at 16:00

0 Answers0