当前位置:   article > 正文

centos7 安装 mysql5.7

centos7 安装 mysql5.7

命令记录,未整理;

1. 下载mysql5.7的安装包,上传到linux系统某个目录中

2. 使用tar -xvf 解压 tar包

tar -xvf mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar

3. 使用 rpm -ivh  安装 mysql
rpm -ivh mysql-community-common-5.7.35-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.35-1.el7.x86_64.rpm


刷新权限,然后输入改密码的命令
flush privileges;
修改密码
alter user root@localhost identified by 'Zzq123456';

systemctl stop mysqld
systemctl status mysqld
systemctl start mysqld


#binlog日志过期天数设置
#expire_logs_days=7 

server-id = 1
binlog-do-db=crmeb
#binlog-do-db=
binlog-ignore-db=mysql
binlog-ignore-db=information_schema
binlog-ignore-db=performance_schema
binlog-ignore-db=sys
#expire_logs_days=7


---------------------------
show databases;
use mysql;
show tables;

CREATE USER 'zzq'@'%' IDENTIFIED BY 'Zzq123456';

GRANT ALL ON *.* TO 'zzq'@'%';

FLUSH PRIVILEGES;

------------------------------------

show databases;
use mysql;
show tables;

SELECT User, Host FROM mysql.user;


GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Zzq*123456' WITH GRANT OPTION;

FLUSH PRIVILEGES;

exit


-----------------------------------------
查看3306端口:
netstat -talnp 
-----------------------------------------
查看防火墙状态:
systemctl status firewalld

firewall-cmd --state

-----------------------------------------
虚拟机:192.168.124.101
mysql 在虚拟机上本地登录的密码:root   Zzq123456
mysql 在虚拟机上远程登录的密码:root   Zzq*123456

ps -ef |grep mysql

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

闽ICP备14008679号