Forget MySQL Root Password
1. Stop the mysql service
>/etc/init.d/mysql stop
2. Start the server without password
>mysqld_safe --skip-grant-tables &
3. connect to the mysql server
>mysql -u root
4. setup new MYSQL root user password
>use mysql;
>update user set password=PASSWORD("CHANGE ME") where User = 'root';
>fulsh privileges;
>quit
5. Restart the Server
>/etc/init.d/mysql stop
>/etc/init.d/mysql start
6. Test the result
>mysql -u root -pChangeMe
7. Create a schema and grant the privileges to a user
>show databases;
>create database reviewboard;
>use mysql;
>grant all privileges on reviewboard.* to reviewboard@"%" identified by 'reviewboard';
>flush privileges;
references:
http://www.debian-administration.org/articles/442
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
http://sillycat.iteye.com/blog/562672
1. Stop the mysql service
>/etc/init.d/mysql stop
2. Start the server without password
>mysqld_safe --skip-grant-tables &
3. connect to the mysql server
>mysql -u root
4. setup new MYSQL root user password
>use mysql;
>update user set password=PASSWORD("CHANGE ME") where User = 'root';
>fulsh privileges;
>quit
5. Restart the Server
>/etc/init.d/mysql stop
>/etc/init.d/mysql start
6. Test the result
>mysql -u root -pChangeMe
7. Create a schema and grant the privileges to a user
>show databases;
>create database reviewboard;
>use mysql;
>grant all privileges on reviewboard.* to reviewboard@"%" identified by 'reviewboard';
>flush privileges;
references:
http://www.debian-administration.org/articles/442
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
http://sillycat.iteye.com/blog/562672