1) 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump -uroot -p rbac > rbac.sql' at line 1
解决办法
find / -iname mysqldump
目录执行
2) 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AUTO_INCREMENTCOMMENT '书id',
`bookName` VARCHAR(100) NOT NULL COMMENT '书名' at line 2
解决办法
3)can't connect to server on 10061
解决办法
重新服务
4)
解决办法
执行如下命令:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
5)error: 'Access denied for user 'root'@'localhost' (using password: NO)'
解决办法
重置密码的第一步就是跳过MySQL的密码认证过程
方法如下:
#vim /etc/my.cnf
在文档内搜索mysqld定位到[mysqld]文本段:
/mysqld(在vim编辑状态下直接输入该命令可搜索文本内容)
接下来我们需要重启MySQL:
# service mysqld restart
然后再输入# mysql -u root -p
。一直按enter就可以顺利进入数据库
进入数据库后
依次输入以下命令:
show databases;
use mysql;
select *from user;
创建一个新的登陆用户:
create user 'root'@'localhost' identified by '123456@abc.COM';
此步骤可能会报以下错误,没报错的跳过(直接到权限那一步),用一下方法解决:
flush privileges;刷新配置
drop user 'root'@'localhost';
赋予root权限
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
#赋予所有库所有表操作权限
mysql> flush privileges;
mysql> exit;
错误的原因是 5.7版本下的mysql数据库上已经没有password这个字段了,password字段改成了authentication_string
select user ,authentication_string from user;
到这一步没有报错,表明已经成功了
恢复最开始的配置文件
# vim /etc/my.cnf
删除配置文件中的:
skip-grant-tables
退出,重启mysql
# service mysqld restart
使用刚刚设置的用户名和密码登陆,就可以顺利登陆了
update mysql.user set authentication_string=password('123456@abc.COM') where user='root'; #修改成功
flush privileges; #立即生效
6)ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解决办法
https://www.cnblogs.com/blyn/p/16281311.html