Mysql grant


Some mysql grant queries

Granting permission for a particular  DB only
mysql> grant all privileges on databasename.* to 'username'@'localhost';
mysql> flush privileges; 

Granting Permission for all the DB
mysql> grant all privileges on *.* to 'username'@'localhost'; 

Granting Permission from a particular IP
# grant all privileges on *.* to 'username'@'192.168.0.20'; 

 # grant usage on *.* to bob@localhost identified by 'passwd'; 
# SHOW GRANTS FOR 'admin'@'localhost';

Granting selected privilages for user

# grant select,insert,update,delete,create,drop on TestDb.* to 'ctechz'@'localhost' identified by 'ctechz';

 After creating the user give permission to him using grant
# create user username identified by 'password';
# GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' WITH GRANT OPTION;
 -- % means from all host.


Terima kasih telah membaca artikel tentang Mysql grant di blog Tutorial Opensource and Linux jika anda ingin menyebar luaskan artikel ini di mohon untuk mencantumkan link sebagai Sumbernya, dan bila artikel ini bermanfaat silakan bookmark halaman ini di web browser anda, dengan cara menekan Ctrl + D pada tombol keyboard anda.

Artikel terbaru :

  • How To Install Cinnamon In Ubuntu 14.04
  • How To Install Mate Desktop In Ubuntu 14.04
  • Creating the first Windows Server 2003 Domain Controller in a domain
  • How To Install Ubuntu 13.10 Server
  • How to Install Nuvola Player in Ubuntu
  • How to establish Emerald in Ubuntu 13.10 & Linux Mint 16
  • How to Restoring iptables Automatically On Boot on Debian and Ubuntu
  • How to Compile FFMPEG with H.264 and LAME in Ubuntu And Debian
  • How to Install Linux on a Playstation 2
  • apt-fast: Improve apt-get Download Speed
  • Artikel terkait :