当前位置:   article > 正文

Linux系统下mysql8.0.24安装,简单易懂(mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar)_linux mysql8.0.24 el7安装

linux mysql8.0.24 el7安装

1.官网下载mysql安装包大约756M大小
在这里插入图片描述
2.将软件包上传到服务器
rz -be mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar
3.检查服务器上是否安装了之前的mysql或者mariadb,如果有安装过则,进行卸载
检查安装过:
rpm -qa |grep mysql
rpm -qa |grep mariadb
进行卸载:
rpm -e 软件包,如果卸载不掉,则用yum卸载
yum -y remove mariadb-libs-5.5.65-1.el7.x86_64

4.解压压缩包,进行安装mysql,安装过程中缺少依赖包则进行安装依赖包
tar -xf mysql-8.0.24-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql
rpm -ivh mysql-community-common-8.0.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.24-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.24-1.el7.x86_64.rpm
rpm -qa | grep mysql 查看是否已经安装

5.创建mysql用户组和mysql用户
groupadd mysql
useradd -g mysql mysql
6.通过以下命令,完成对 mysql 数据库的初始化和相关配置
chown -R mysql.mysql /usr/local/mysql/
systemctl start mysqld.service
systemctl enable mysqld
7.查看默认密码,进行登录,重新设置密码
grep password /var/log/mysqld.log
mysql -uroot -p

mysql> alter user root@‘localhost’ identified by ‘Sccin1qazCDE#’
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘Ljtao2020!’;#修改root用户密码
GRANT ALL ON . TO ‘root’@’%’ ; #授权root用户可以远程登陆

flush privileges; #立即生效

8.设置my.cnf配置文件,需要什么要求设置什么配置
(1)不区分大小写
systemctl stop mysqld

vim /etc/my.cnf
lower_case_table_names = 1
保存
systemctl start mysqld
grep password /var/log/mysqld.log
mysql> alter user root@‘localhost’ identified by ‘Sccin1qazCDE#’
mysql> flush privileges;
mysql> show variables like “%case%”
-> ;
±-----------------------------------±------+
| Variable_name | Value |
±-----------------------------------±------+
| lower_case_file_system | OFF |
| lower_case_table_names | 1 |
| validate_password.mixed_case_count | 1 |
±-----------------------------------±------+
自此设置成功

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/554037
推荐阅读
相关标签
  

闽ICP备14008679号