Monday, March 12, 2012

Creating / Changing MySQL Password

Steps for creating user on MySQL
1. Login to MySQL as root and then follow this step
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';

2. Grant Access to the user
GRANT ALTER,SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
ON database_name.* TO 'user_name'@'localhost';

Here are steps for changing root password (in case root password is blank)
/usr/bin/mysqladmin -u root password 'new-password'

If you are using hostname
/usr/bin/mysqladmin -u root -h honda.pacomnet.com password 'new-password'

No comments: