centos7.4系统中yum源安装mysql 5.6
系统环境: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 'root'@'localhost'=password('userpasswd');
九、配置防火墙
firewall-cmd --zone=public --add-port=3306/tcp --permanent
相关文章
MySQL如何设置动态创建时间(create_time)和修改时间(update_time)
本文主要介绍了MySQL如何设置动态创建时间(create_time)和修改时间(update_time),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2023-05-05


最新评论