安装出现的问题:
1.启动mysql,输入密码错误导致的报错:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决:https://blog.csdn.net/qq_36228916/article/details/99632783
改mysql密码:
[root@mas /]# mysql -u root -p
mysql> use mysql;
mysql> update user set password=password(“你的新密码”) where user=“root”;
mysql> flush privileges;
mysql>exit;
更多方式:https://www.cnblogs.com/peashooter/archive/2018/08/10/9456255.html
2.配置文件出错导致的异常:
mysql: [ERROR] unknown variable 'symbolic-links=0'.
解决:
查看my.cnf文件,文件中
# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
应该是分两行展示了,修改该行为一行显示
3.my.cnf 配置文件中设置了 [mysqld] 的参数 socket ,而没有设置[client]的参数socket:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
解决:添加 [client] 配置项,如下所示
4.启动mysql报错:mysqld_safe error: log-error set to /var/log/mariadb/mariadb.log
解决:
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
# 用户组及用户
chown -R mysql:mysql /var/log/mariadb/
/usr/local/mysql/support-files/mysql.server start
5.navicat连接数据库失败(1):
can't connect to mysql server on localhost(10060)
原因:防火墙的问题,3306端口没有开放
解决:开放3306端口或者关闭防火墙,命令如下
1:查看防火状态
systemctl status firewalld(方式一)
service iptables status(方式二)
2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
3:永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart
6.navicat连接数据库失败(2):
1130-host 'xxx' is not allowed to connect to this mysql server
解决:
1.修改user表中的Host:update user set Host='%' where User='root';
2.最后刷新一下:flush privileges;
原文链接:https://www.cnblogs.com/asplover/p/13966533.html
学习:虚拟机CENTOS7下 安装8.0版本MySQL MySQL主从配置详细~
https://blog.csdn.net/weixin_42859280/article/details/84587330