/ Published in: SQL
Creating users in MySQL.
Expand |
Embed | Plain Text
;Create a new user named "myuserinlocalhost" only FOR localhost WITH the password "passwordinlocalhost" CREATE USER 'myuserinlocalhost'@'localhost' IDENTIFIED BY 'passwordinlocalhost'; ;Create a new user name "myuserforanydomain" FOR any domain but localhost WITH the password "otherpassword" CREATE USER 'myuserforanydomain'@'%' IDENTIFIED BY 'otherpassword'; ;Create a new user name "myuserforanydomain" FOR only 172.22.200.133 IP WITH the password "otherpassword" CREATE USER 'myuserforanydomain'@'172.22.200.133' IDENTIFIED BY 'otherpassword'; ;Grant privileges TO an user GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON npblog_db.* TO 'npblog_sch_db'@'localhost' IDENTIFIED BY 'password'; ;refresh FLUSH privileges;
You need to login to post a comment.
