- [root@test100 bin]# mkdir /opt/mysql
- [root@test100 bin]# cd /opt/mysql
- [root@test100 mysql]# ll
总用量 518444
-rw-r–r--. 1 root root 530882560 3月 27 23:41 mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
- [root@test100 mysql]# tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
- [root@test100 mysql]# ls
mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.26-1.el7.x86_64.rpm
mysql-community-client-5.7.26-1.el7.x86_64.rpm mysql-community-libs-5.7.26-1.el7.x86_64.rpm
mysql-community-common-5.7.26-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm
mysql-community-devel-5.7.26-1.el7.x86_64.rpm mysql-community-server-5.7.26-1.el7.x86_64.rpm
mysql-community-embedded-5.7.26-1.el7.x86_64.rpm mysql-community-test-5.7.26-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.26-1.el7.x86_64.rpm
tips:CnetOD7.6自带的类mysql数据库是mariadb,会跟mysql冲突,要先删除
[root@test100 mysql]# rpm -qa | grep mari
文章图片
- [root@test100 mysql]# rpm -e --nodeps mariadb-libs
[root@test100 mysql]# rpm -e --nodeps marisa-0.2.4-4.el7.x86_64
[root@test100 mysql]# rpm -qa | grep mari
文章图片
- 按顺序执行安装
[root@test100 mysql]# rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
[root@test100 mysql]# rpm -ivh mysql-community-libs-5.7.26-1.el7.x86_64.rpm
[root@test100 mysql]# rpm -ivh mysql-community-client-5.7.26-1.el7.x86_64.rpm
[root@test100 mysql]# rpm -ivh mysql-community-server-5.7.26-1.el7.x86_64.rpm
- 启动服务
[root@test100 mysql]# systemctl start mysqld.service
- 【linux|[linux-29] 安装mysql5.7(CentOS7.6)】设置root用户密码
mysql自动给root用户设置随机密码,运行grep “password” /var/log/mysqld.log,可看到当前密码
- 运行mysql -u root -p,用随机密码登录
生产环境的密码,要尽可能复杂
set global validate_password_policy=0;
(validate_password_policy默认值是1)
set password for ‘root’@‘localhost’=password(‘hspedu100’);
11.flush privileges;
是密码设置生效
文章图片
文章图片
推荐阅读
- linux|[linux-28] 安装idea2020
- linux|[linux-18] crontab和at定时任务调度
- linux|[linux-26] 安装JDK
- linux|[linux-27] 安装tomcat
- linux|[linux-11]找回root密码
- Linux通过ssh连接手机安卓手机上的Termux
- linux之dd命令
- linux|cobbler补鞋匠
- Socket 通信原理(Android客户端和服务器以TCP&&UDP方式互通)