mysql root password rest -
mysql root password rest -
for reason, script below doesn't reset root password. script works in performs steps, when seek log in mysql root new password, doesn't recognize alter , insists utilize old one.
here script below:
#!/bin/bash echo "resetting root password" sudo /etc/init.d/mysql stop sleep 2 if [ -f /root/mysql.reset.sql ]; rm -f /root/mysql.reset.sql touch /root/mysql.reset.sql else touch /root/mysql.reset.sql fi echo "update mysql.user set password=password('akimbo') user='root'; flush privileges;" >> /root/mysql.reset.sql mysqld_safe --init-file=/root/mysql.reset.sql & /etc/init.d/mysql start sleep 2 echo "done setting mysql password user root. password password." so when seek mysql -uroot -pakimbo complains , works when utilize old password.
any ideas?
cheers
why not utilize mysqladmin command?
mysqladmin -u root -p'oldpassword' password newpass
this can used changing other user's passwords well:
mysqladmin -u sql_username -p oldpassword password newpass
mysql passwords root
Comments
Post a Comment