Lupa pass root mysql
Yah namanya orang lupa.. ini gua copas dari sini, biar gak lupa
Step # 1: Stop MySQL
Type the following command to stop mysql server under RHEL / Fedora / CentOS Linux:
# /etc/init.d/mysqld stop
Use the following command if you are using FreeBSD:
# /usr/local/etc/rc.d/mysql-server stop
Use the following command if you are using Debian / Ubuntu Linux:
# /etc/init.d/mysql stop
Alternatively, you can stop the MySQL server by sending a kill to the mysqld process, using the path name of the .pid file in the following bash specific command:
# kill $(cat /var/run/mysqld/mysqld.pid)
OR
# pgrep -u mysql mysqld
# kill PID
Or, simply use killall command under Linux:
# killall mysql
Step # 2: Create new mysql password sql script
Create a sql file called /root/mysql.reset.sql as follows (replace YOUR-NEW-MYSQL-PASSWORD with actual new password you would like to use):
# vi /root/mysql.reset.sql
Append the following code:
UPDATE mysql.user SET Password=PASSWORD('YOUR-NEW-MYSQL-PASSWORD') WHERE User='root'; FLUSH PRIVILEGES;
Save and close the file.
Step # 3: Set new mysql root password
Type the following command:
# mysqld_safe --init-file=/root/mysql.reset.sql &
Sample output:
nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[20970]: started
And you are done with resetting operation. Simply, stop server and start again:
# killall mysqld
# /etc/init.d/mysql start
wonggoblog berkata,
Juni 6, 2009 pada 10:05 AM
ehm , pake bahasa inggris
kalo mau ngoprek squid boleh buka blog awa, udah awa dokumentasiin
http://wonggoblog.wordpress.com
riz berkata,
Juni 6, 2009 pada 1:49 PM
bukan pake bahasa inggris tapi copas dari situs basa inggris…