laptop-codeUse one of the following commands to grant ALL PRIVILEGES to a MySQL

user: All databases, All table

  1. user: All databases

GRANT ALL PRIVILEGES ON database_name.* TO 'username''@'localhost';
  1. All table databases

GRANT ALL PRIVILEGES ON database_name.table_name TO 'username'@'localhost';
  1. เปลี่ยนหรืออัพเดท password ของ user

ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
flush privileges;

Last updated