2017年6月29日 星期四

MacOSX homebrew reset mysql root password

If brew installed MySQL 5.7, the process is a bit different than for previous versions. In order to reset the root password, proceed as follows:
sudo rm -rf /usr/local/var/mysql
mysqld --initialize
A temporary password will be printed to the console and it can only be used for updating the root password:
mysql.server start
mysql -uroot -pTEMPORARY_PASSWORD
mysql> SET PASSWORD FOR '目標使用者'@'主機' = PASSWORD('密碼');
mysql> flush privileges;


from :
1)https://stackoverflow.com/questions/4359131/brew-install-mysql-on-mac-os/33924648#33924648
2)http://emn178.pixnet.net/blog/post/87659567-mysql%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A2%BC%E8%88%87%E5%BF%98%E8%A8%98%E5%AF%86%E7%A2%BC%E9%87%8D%E8%A8%AD

沒有留言:

wibiya widget