I am aware that this question has been asked already on stackoverflow but I don't see any answer for the actual question posted. Hence posting again.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD 'abcd' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'::1' IDENTIFIED BY PASSWORD 'abcd' WITH GRANT OPTION;
Above lines throw
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 PASSWORD 'abcd' WITH GRANT OP' at line 1
I am trying to upgrade mysql from 5.7 to latest 8.0.21
Thanks!
For GRANT ALL
privileges to root user use the following syntax:
GRANT ALL PRIVILEGES ON database_name.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
The above grant mysql command defines that:
dbname
and it applies to all tables of that database indicated by the.* that follows the dbname.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.