centos7.4系统中yum源安装mysql 5.6
程序员文章站
2022-06-24 22:19:11
系统环境:centos7.4
一,查看是否安装有数据库:
yum list installed | grep mysqld/mariadb
二,安装centos7系统...
系统环境:centos7.4
一,查看是否安装有数据库:
yum list installed | grep mysqld/mariadb
二,安装centos7系统带有mysql5.6安装包的yum源rpm资源包:
rpm -uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm yum clean all yum repolist
三,安装msyql5.6:
yum -y install mysql-community-server
四,启动服务:
systemctl start mysqld systemctl enable mysqld
五,重置密码:是具体情况而定(可以省略,无密码登陆)
#mysql_secure_installation set root password? [y/n] y [设置root用户密码] remove anonymous users? [y/n] y [删除匿名用户] disallow root login remotely? [y/n] n [禁止root远程登录] remove test database and access to it? [y/n] y [删除test数据库] reload privilege tables now? [y/n] y [刷新权限]
六,查看mysql版本:
mysql -v mysql ver 14.14 distrib 5.6.39, for linux (x86_64) using editline wrapper
七,验证:(无密码)
mysql -uroot -p 密码
八、设置密码和远程权限
数据库密码设置:#set password for );
九、配置防火墙
firewall-cmd --zone=public --add-port=3306/tcp --permanent
上一篇: 白芸豆炖多久能熟
下一篇: 魏章:张仪的至交好友,一战成名结局如何?