[MySQL] mac 中 mysql 登入失敗
mysql mac
- Stop the mysqld server. Typically this can be done by from ‘System Prefrences’ > MySQL > ‘Stop MySQL Server’
- Start the server in safe mode with privilege bypassFrom a terminal:sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
- In a new terminal window:sudo /usr/local/mysql/bin/mysql -u rootUPDATE mysql.user SET Password=PASSWORD(‘NewPassword’) WHERE User=‘root’;FLUSH PRIVILEGES;\q
- Stop the mysqld server again and restart it in normal mode.
到了第三步會出現問題:
ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’
ERROR 1054 (42S22): Unknown column ‘password’ in ‘field list’
改成
update MySQL.user set authentication_string=password(‘root’) where user=‘root’ ;
就可以更改成功了
update MySQL.user set authentication_string=password(‘root’) where user=‘root’ ;
就可以更改成功了
之後退出安全模式
重新登入
http://blog.csdn.net/u010603691/article/details/50379282
https://www.variphy.com/kb/mac-os-x-reset-mysql-root-password
https://www.variphy.com/kb/mac-os-x-reset-mysql-root-password
重新登入就可以了 不過 直接輸入mysql 登入會出現找不到命令
要把mysql 加到環境命令中
mysql command not found
.bash_profile
export PATH=${PATH}:/usr/local/mysql/bin
留言
張貼留言