我的个人博客地址:
添加源
下载rpm包
wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
安装Mysql源
sudo rpm -Uvh mysql-community-release-el6-5.noarch.rpm
查看mysql源
yum repolist all | grep mysql
如果正常 你就能看到mysql 5.6社区版啦。
编辑下载源
在/etc/yum.repos.d/mysql-community.repo中你可以看到类似
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
通过配置 enable等于1或者0 来决定启用那个版本。
例如我启用了Mysql5.7
# Note: MySQL 5.7 is currently in development. For use at your own risk.
# Please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/
[mysql57-community-dmr]
name=MySQL 5.7 Community Server Development Milestone Release
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
安装mysql
开始安装
sudo yum install mysql-community-server
启动mysql
service mysqld start
如果是mysql5.7会生成初始密码,用下面命令查看
sudo grep 'temporary password' /var/log/mysqld.log
然后你就可以对mysql 为所欲为了。
配置mysql
然而事情并没有结束,mysql初始配置,占用的内存非常高。Then,what can I do.
参考。相当详细。
当然你也可以参考MysqL.com/doc/MysqL-yum-repo-quick-guide/en/">MysqL官方文档,非常详细。请叫我教程搬运工。
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。