Entries Tagged as 'change'

log in mysql from command prompt windows to access database and change passwords grant privialiges Create users

First of all you should know how you can add users in mysql databases:-

  • Using CREATE USER and/or GRANT commands
  • Inserting a new record into the mysql.user table

First let’s see how to use the CREATE USER command:-

     CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']

e.g

mysql>CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
Once user added in databases you need to provide privileges to that user.You can use like:-

mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'myuser'@'localhost';
or mysql>GRANT ALL ON *.* TO 'myuser'@'localhost';

Another way for creating users in mysql is just enter directoly in user table of mysql and make few entries:-
mysql> INSERT INTO user VALUES('localhost','monty',PASSWORD('some_pass'),
     'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
or
mysql> INSERT INTO user (Host,User,Password) VALUES('localhost','usename','pass');
mysql> FLUSH PRIVILEGES;