The MySQL access control system enables you to create MySQL accounts and define what each account can do. The steps bellow to create a new user MySQL account.
Step 1: Login MySQL as root
mysql -u root -p
Step 2: Using GRANT command to create new MySQL account
mysql> GRANT ALL ON <database_name>.* TO <new_account>@<server> IDENTIFIED BY '';
Example: I have database called demo and i want to assign all privileges to new account called user1, i will type the following command:
mysql> GRANT ALL ON demo.* TO user1@localhost IDENTIFIED BY 'mypassword';
Note: GRANT ALL is means set all privileges to new account. But only on demo database and can’t access other database. Read more about database privileges.
Step 3: Exit MySQL interface
Step 4: Login MySQL with new Account
mysql -u <new_account> -p
Replace <new_account> by your new account created.
- How To Install Subversion (SVN) Extension Working With PHP 5.3
- How To Setup Iptables Firewall For A Web Server On CentOS
- How Do I Fix “Host is blocked because of many connection error” In MySQL
- How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM
- Repel port flood by CSF and IPT_Recent
- What is the role of this variables in php.ini file (expose_php – allow_url_fopen – register_globals) ?
- How Do I Block An IP Address On Linux Server ?
- How To Flush The Entire Contents Of Memcache Server
- How To Setup A LAMP Server On Centos 6.0
- Linux Shutdown Command