Adding User Accounts to mysql




http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

When we want to connect to a remote DB, we need to allow the present machine to connect to that remote DB.
For that we need add an user, with the host name like "192.168.0.120" with necessary permissions.
We can also set the option "Allow Remote machines to connect to this DB" while installing mysql.

mysql -u root -p
root
use mysql;
create user 'username'@'ip' identified by 'password';
grant all privileges on databaseSchema.* to 'username'@'192.168.0.120';
flush privileges;


mysql -u root -p
root
use mysql;
create user 'root'@'192.168.0.120' identified by 'root';
grant all privileges on dcon.* to 'root'@'192.168.0.120';
flush privileges;


(Have a DB Schema dcon: inside we have some tables: setting dcon.* means allow for all the tables inside the dcon schema)