当前位置: 移动技术网 > IT编程>数据库>Mysql > 在CentOS7系统上安装MySQL数据库

在CentOS7系统上安装MySQL数据库

2018年10月05日  | 移动技术网IT编程  | 我要评论

1.下载安装mysql官方repo文件

下载mysql的官方repo文件

[root@centos7 ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

安装mysql的官方repo文件

[root@centos7 ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm

2.安装mysql数据库

[root@centos7 ~]# yum -y install mysql-community-server

3.配置mysql数据库

启动数据库并查看数据库启动状态。

[root@centos7 ~]# systemctl start mysqld

[root@centos7 ~]# systemctl status mysqld

查看数据库安装的初始密码:

[root@centos7 ~]# grep "password" /var/log/mysqld.log

[root@centos7 ~]# mysql_secure_installation

enter password for user root:---------------------------------------->使用查询到的密码

new password:--------------------------------------------------------->输入新密码

re-enter new password:--------------------------------------------->重复密码

do you wish to continue with the password provided?(press y|y for yes, any other key for no) : y

其他参数根据实际情况选择。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网