LOGIN IN MYSQL :
#mysql -u root -p
AFTER LOGIN CREATE DATABASE :
#mysql -u root -p
mysql>create database database_name ;
ex: create database student ;
check database is create or not
mysql>show database;
Now I want to some use access only this databas :
mysql>SELECT host FROM mysql.user WHERE User = 'root';
How many user in database :
mysql> SELECT User, Host FROM mysql.user;
CREATE USER :
mysql> CREATE USER 'db_user'@'192.168.0.1' IDENTIFIED BY 'db_passwd';
GIVE FULL PERMISSION AT DATABASE
mysql> GRANT ALL PRIVILEGES ON *.* TO 'db_user'@'192.168.0.1' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
CREATE READ ONLY USER IN MYSQL
mysql>GRANT SELECT ON Student.* TO db_user@'192.168.0.1';
No comments:
Post a Comment