title: mysql1
date: 2017-05-30 21:57:27
tags: mysql
执行更改密码,结果提示
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
SET SQL_SAFE_UPDATES = 0;
执行完记得改回去 SET SQL_SAFE_UPDATES = 1;
忘记了root密码怎么办?
停止 mysql server. 通常是在 ‘系统偏好设置’ > MySQL > ‘Stop MySQL Server’
打开终端,输入:sudo /usr/local/mysql/bin/mysqld_safe –skip-grant-tables
打开另一个新终端,输入:
sudo /usr/local/mysql/bin/mysql -u root
UPDATE mysql.user SET authentication_string=PASSWORD(‘新密码’) WHERE User=’root’;重启MySQL.
以上方法针对 MySQL V5.7.9, 旧版的mysql请使用:UPDATE mysql.user SET Password=PASSWORD(‘新密码’) WHERE User=’root’;
如何让局域网访问
1 | use mysql; |