centos 7.6 版本安装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’;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值