MySQL privileges

MySQL privileges notes :-

1. ล็อกอินฐานข้อมูลด้วยผู้ใช้รูท (with the root user login)

mysql -h 127.0.0.1 -u root -p

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.0.26

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

2. ตรวจสอบสิทธิ (view privileges)

mysql> show grants for 'root'@'localhost';

3. กำหนดการให้สิทธิเฉพาะบ้างฐานข้อมูล (user gives permission to a specific database)

mysql> grant select,insert,update,delete,create,drop on syslogadmin.* to 'syslogadmin'@'localhost' identified by 'syslogadmin';<b

หรือให้สิทธิทุกโฮสต์

mysql> grant select,insert,update,delete,create,drop on syslogadmin.* to 'syslogadmin'@'*'identified by 'syslogadmin';<b

Leave a Reply

Your email address will not be published. Required fields are marked *

Please validate : * Time limit is exhausted. Please reload CAPTCHA.