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’;
本文地址:https://blog.csdn.net/qq_48644092/article/details/108985597
上一篇: PHP中的变量覆盖漏洞深入解析
推荐阅读
-
Centos7.0安装ceph(JEWEL)及以上版本的实例解析
-
CentOS7 64位下MySQL5.7安装与配置
-
阿里云ECS centos6.8下安装配置MySql5.7的教程
-
CentOS7.6安装MYSQL8.0的步骤详解
-
浅析CentOS6.8安装MySQL8.0.18的教程(RPM方式)
-
CentOS 6.2 安装 MySQL 5.7.28的教程(mysql 笔记)
-
Centos7 下Mysql5.7.19安装教程详解
-
centos6.5中rpm包安装mysql5.7初始化出错的解决方法
-
Centos7.3下mysql5.7安装配置教程
-
mysql安装配置方法图文教程(CentOS7)