Can any one tell me how to create a new user and password in mysql? When user connect to the local database server as user root it will ask for password. Any recommendations and suggestions are appreciated.
Can any one tell me how to create a new user and password in mysql? When user connect to the local database server as user root it will ask for password. Any recommendations and suggestions are appreciated.
For adding a new user to MySQL you just need to add a new entry to user table in database mysql. You need to use command mysql> INSERT INTO user in () declare the variable and in values assign the value for the variable.
You can also specify other privileges to a new user by setting the values of these columns in user table to 'Y' when executing the INSERT query : Select_priv, Insert_priv, Update_priv. To create a user who has access from all machines in a given domain, you can use the “%” wildcard character in the host part of the account name.
To create user in mysql :
You can create a new MySQL user in one step using GRANT command :Code:CREATE USER 'user20'@'localhost' IDENTIFIED BY 'pass1';
Code:GRANT ALL ON *.* TO 'user21'@'localhost' IDENTIFIED BY 'pass1';
Bookmarks