Centos7离线安装mysql5.7
程序员文章站
2024-03-25 20:26:28
...
1、mysql官网下载离线安装包mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar
2、将mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar安装包上传到centos服务器/data/soft目录下,并解压
tar -xvf mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar
3、卸载CentOS7系统自带的mariadb
rpm -qa|grep mariadb
rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
4、安装mysql-community-common-5.7.29-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.7.29-1.el7.x86_64.rpm
5、安装mysql-community-libs-5.7.29-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.29-1.el7.x86_64.rpm
6、安装mysql-community-client-5.7.29-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.29-1.el7.x86_64.rpm
7、安装server
rpm -ivh mysql-community-server-5.7.29-1.el7.x86_64.rpm
此步报错,根据报错信息,需要安装perl、net-tools、libaio.so依赖
安装perl依赖
yum install perl*
yum install cpan
安装net-tools依赖
yum install net-tools
安装libaio.so依赖
yum install libaio
上面的三个依赖安装完后,重新安装server,如下图,就可以安装成功了
8、如下图将/var/log/mysqld.log文件下载到本地,并右边红框中的密码copy到记事本中记下,
使用下面语句进行登录,并将上一步获取到的密码copy密码输入处理,如下图登录成功
mysql -u root -p
9、修改密码
# 修改密码
alter user 'root'@'localhost' identified by '123456aB?';
# 使密码生效
flush privileges;
# 允许以root身份远程登录mysql
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456aB?' WITH GRANT OPTION;
10、使用客户端工具Navicat for MySQL进行远程接连接数据库
上一篇: 8.10Dubbo框架里的微服务组件
下一篇: Android ListView