欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

centos 7.6 版本安装Mysql

程序员文章站 2022-05-01 19:58:25
1、安装epel源#yum -y install epel-release2、 安装Mysql Repository#yum -y install wget#wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm //下载mysql官方yum源安装包#yum -y install mysql57-community-release-el7-11.noarch.rpm //安装3、安装MySQL需...

1、安装epel源
#yum -y install epel-release
2、 安装Mysql Repository
#yum -y install wget

#wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm //下载mysql官方yum源安装包

#yum -y install mysql57-community-release-el7-11.noarch.rpm //安装

3、安装MySQL
需要安装MySQL Server,MySQL client已经包括在server套件内
#cd /etc/yum.repos.d/
#ls
#yum -y install mysql-community-server mysqld //安装服务端,客户端
#systemctl start mysqld //启动mysqlfuw
#systemctl enable mysqld //设置mysql服务开机启动
#ls /var/lib/mysql //查看mysql安装
#grep ‘password’ /var/log/mysqld.log //获取首次登陆密码,复制密码
#mysql -uroot -p’awm3>!QFl6zR’ //登陆mysql数据库
mysql > alter user ‘root’@‘localhost’ identified by ‘Qf.123.com’; //修改mysql数据库密码(密码必须符合复杂性要求,包含字母大小写,数字,特赦符合,长度不少于8位)
\q //退出数据库
#mysql -uroot -p’Qf.123.com’ //用新密码登陆数据库

4、重启MySQL
#systemctl restart mysqld
5、创建qfedu库并设置权限
#mysql -uroot -p
mysql>create datebase qfedu character set utf8 collate utf8_bin
mysql>show datebase;
mysql>grant select,insert,update,delete,create,drop,alter,index onqfedudb.* to ‘qfedu’@‘localhost’ identified by ‘Yangge.123com’;
mysql>flush privileges; //刷新
mysql>show grants for ‘qfedu’@‘localhost’;

本文地址:https://blog.csdn.net/qq_48644092/article/details/108985597

相关标签: linux centos