背景
快速直达
内容
mysql 5.7.11
wget http://dev.MySQL.com/get/Downloads/MySQL-5.7/mysql-5.7.11-Linux-glibc2.5-x86_64.tar.gz
mysql 8.0.13
下载安装包
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-common-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-libs-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.13-1.el7.x86_64.rpm
wget https://mirrors.163.com/mysql/Downloads/MySQL-8.0/mysql-community-server-8.0.13-1.el7.x86_64.rpm
安装
rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
遇到冲突的旧包,将其卸载掉。遇到没有安装的包,手动将其安装上。
启动
初始化数据库
mysqld --initialize --console
目录授权,否则启动失败
chown -R mysql:mysql /var/lib/mysql/
启动服务
systemctl start mysqld
加密
mysql_secure_installation
进入
默认密码在 mysqld.log
中可以找到。
grep pass /var/log/mysqld.log
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于