centos6.6yum安装mysql

前端之家收集整理的这篇文章主要介绍了centos6.6yum安装mysql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我的个人博客地址:

添加源

下载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官方文档,非常详细。请叫我教程搬运工。

猜你在找的CentOS相关文章