- Apache (9)
- DNS / BIND (2)
- General Linux (7)
- Mail (8)
- Postfix (1)
- Qmail (4)
- Sendmail (3)
- MySQL (7)
- News (1)
- Other (2)
- Perl (1)
- PHP (5)
- Plesk (13)
- Redhat Linux (8)
- Ruby (1)
- Scripts (4)
- Security (4)
- iptables (2)
TopicNavigationUser login |
Adding MySQL Users / Setting User PrivilegesThe syntax for adding a user is: mysql> GRANT [privs] ON [db] TO [user]@[host] IDENTIFIED BY [pass]; e.g. mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'bob'@'localhost' IDENTIFIED BY '3kuh3Ok'; Would grant all privileges on the testdb database to the local user bob, with password 3kuh3Ok. A few things to note: Grant statements can also change the permissions on an existing user. For example: mysql> GRANT ALL PRIVILEGES ON bobs_db.* TO bob@'%' IDENTIFIED BY 'a5u19kb'; mysql> GRANT SELECT,INSERT ON blog_db.omgdata TO bob@'%'; Would create a user bob@'%' (any remote host) with password a5u19kb, and grant the user full privileges on database 'bobs_db', and then ALSO grant that user SELECT and INSERT privileges on the omgdata table of the blog_db database. To create a user with no db access, you can use: mysql> GRANT USAGE ON *.* TO user@host IDENTIFIED BY 'password'; |
Linux JournalSlashdot |