การให้สิทธิใน MySQL

การให้สิทธิใน MySQL ใช้คำสั่ง Grant เช่น

[code]
grant all on *.* to jack@localhost identified by ‘xxxx’;
[/code]

เป็นการให้สิทธิทั้งหมดแก่ user jack@localhost

แต่ถ้าต้องการให้สิทธิบางส่วนเช่น ให้สิทธิเฉพาะฐานข้อมูลที่กำหนดให้ใช้คำสั่ง

[code]
grant all on mydb.* to jack@localhost identified by ‘xxxx’;
[/code]

Link