I want to create a new user in MySql. I do not want that new user to do much with my existing databases [I just want to grant Select privilege to him], but he can do anythin
Open mysql command prompt.
To create a new user when host is localhost then use this command
CREATE user 'test_user'@'localhost' identified by 'some_password';
for any host use %, like this
CREATE user 'test_user'@'%' identified by 'some_password';
Once the user is created, you need to Grant some access. Use following command for this.
GRANT SELECT,INSERT,UPDATE
ON database_name.table_name
TO 'test_user'@'localhost';
After successful execution of above query, test_user can select, insert and update in table_name (name of table) of database_name (name of database).