Step # 1 : Stop mysql service
# /etc/init.d/mysql stopOutput:
Stopping MySQL database server: mysqld.Step # 2: Start to MySQL server w/o password:
# mysqld_safe --skip-grant-tables &The output should be something like:
[1] 5988Step # 3: Connect to mysql server using mysql client:
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started
# mysql -u rootOutput:
Welcome to the MySQL monitor. Commands end with ; or \g.Step # 4: Setup new MySQL root user password
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql> use mysql;Step # 5: Stop MySQL Server:
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql stopOutput:
Stopping MySQL database server: mysqldStep # 6: Start MySQL server and test it
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+ Done mysqld_safe --skip-grant-tables
# /etc/init.d/mysql start
# mysql -u root -p
No comments:
Post a Comment