首页 > 数据库技术 > 详细

yum60秒内安装mysql的方法

时间:2019-01-01 22:40:53      阅读:61      评论:0      收藏:0      [点我收藏+]

标签:gpg   face   ted   gre   var   localhost   rep   eas   pos   

一、前言

直接“yum -y install mysql”安装mysql,你会发现,安装的是MariaDB,并且默认是5.5版本,因此如果我们想控制版本,而需要下面的方法

二、安装epel仓库

yum -y install epel-release

三、手动创建mysql的yum源

[root@dabiaoge ~]# cd /etc/yum.repos.d/
[root@dabiaoge yum.repos.d]# vim mysq.repo

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=https://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=https://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=https://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=https://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-cluster-7.6-community]
name=MySQL Cluster 7.6 Community
baseurl=https://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

四、安装mysql

[root@dabiaoge yum.repos.d]# yum -y install mysql-community-server

五、参看版本

[root@dabiaoge yum.repos.d]# mysql -V
mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64) using EditLine wrapper

六、启动数据库,查看初始化密码

[root@dabiaoge yum.repos.d]# systemctl start mysqld
[root@dabiaoge yum.repos.d]# cat /var/log/mysqld.log | grep root@localhost
2019-01-01T11:10:13.006233Z 1 [Note] A temporary password is generated for root@localhost: Nkw6Uma<!p-q

七、修改密码

[root@dabiaoge yum.repos.d]# mysqladmin -uroot -p‘Nkw6Uma<!p-q‘ password 9qlHZ%cy
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
//秘钥要符合复杂性要求,不能小于8位

yum60秒内安装mysql的方法

标签:gpg   face   ted   gre   var   localhost   rep   eas   pos   

原文:https://blog.51cto.com/zpf666/2337582

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 designnerd.net 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号