Linux下安装MySQL 8.0.x
CentOS安装MySQL 8.0.17下载版本选择MySQL的版本:8.0.17(mysql-8.0.17-linux-glibc2.12-x86_64.tar)使用镜像地址:http://iso.mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86_64.tar上传到L...
·
yum 安装MySQL
查找最新版,https://repo.mysql.com
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
# 安装
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
# 选择版本
yum repolist all | grep mysql
结果
mysql80-community/x86_64 MySQL 8.0 Community Server enabled: 129
开始安装
yum -y install mysql-community-server
开始下载,自己安装
service mysqld start
service mysqld status
# 查看临时密码
grep 'temporary password' /var/log/mysqld.log
# 登录
mysql -uroot -p
# 输入刚才的密码
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root@12345';
# 新建root用户
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin@12345';
grant all privileges on *.* to 'admin'@'%' with grant option;
flush privileges;
出现错误
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
# 修改
mysql> set global validate_password.policy=0;
如果连接不上,请查看防火墙
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
你也可以添加自定义规则,但是在内网中,就先不要这样做了。如果是云服务器,需要在管理页面添加端口。
卸载删除 mysql
rpm -qa|grep -i mysql
rpm -e 搜出的包名
find / -name mysql
# 删除搜出来的路径信息
一些错误
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
下载慢
cd /var/cache/yum/x86_64/7/mysql80-community/packages
这是缓存,用迅雷下载后上传到此目录,执行yum update完成。
下载地址:http://uni.mirrors.163.com/mysql/Downloads/MySQL-8.0/
更多推荐
已为社区贡献1条内容
所有评论(0)