Basic MySql Tips
- Tuesday, October 5, 2010, 4:51
- Database, MySQL
- Add a comment
|
|
1. How to set password for root account in MySQL Server??
#mysqladmin -u root password your-new-password
#/etc/init.d/mysqld restart
2. How to add a new user account in MySQL Server??
From mysql frompt
CREATE USER <username> IDENTIFIED BY PASSWORD ‘password’;
3. How to add privilleges to newly created user??
//To grant specified privileges
GRANT SELECT,INSERT,UPDATE ON db_name.* TO ‘username’@'localhost’;
//To grant all privileges
GRANT ALL ON db_name.* TO ‘username’@'localhost’;


