4月 6, 2010
mysqlパスワード忘れた場合
ここの例では、localhostに対してrootのパスワードを再設定する
[root@centos ~]# /etc/init.d/mysqld stop [root@centos ~]# /usr/bin/mysqld_safe --user=root --skip-grant-tables & mysql mysql mysql> update mysql.user set Password=null where Host='localhost' and User='root'; mysql> quit [root@centos ~]# /etc/init.d/mysqld restart [root@centos ~]# mysql -u root mysql> set password for root@localhost=password('新パスワード');