tag: adding user

MySQL manage users

18 Dec, 2011 - 1 minutes
To view all users. SELECT user FROM mysql.user; To add a MySQL user which is able to connect only from the local machine, and have access only to a database called soup. # mysql -u root -p INSERT INTO mysql.user (Host,User,Password) VALUES('localhost','username',PASSWORD('password')); GRANT USAGE ON *.* to username@localhost IDENTIFIED BY 'password'; FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON soup.* TO username@localhost; FLUSH PRIVILEGES; If you don’t run the first “FLUSH PRIVILEGES;” statemtnt you might get the following error: