mysql忘记密码
1.如果没有数据,或者运行初始化,那么直接在偏好设置里,点击Initialize Database即可
2. 有数据下修改(还没验证)
(1)关闭服务sudo /usr/local/mysql/support-files/mysql.server stop
(2)安全模式下启动sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
(3)重新打开一个终端,输入Mysql -u root
(4)然后输入FLUSH PRIVILEGES;SET PASSWORD FOR ‘localhost‘ = PASSWORD(‘重新设置的密码‘);
(5)如果报错:SET PASSWORD FOR = ‘你重新设置的密码‘;
重启mysql就可以访问了。
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11