centos系统默认的mysql yum源是mysql5.1,那么如何通过yum安装mysql的其它版本。 现在需要通过yum安装mysql5.6的版本 1、下载对应os版本的yum源并安装 http://dev.mysql.com/downloads/repo/yum/以mysql57-community-release-el6-8.noarch.rpm为例: rpm -ivh mysql57-community-release-el6-8.noarch.rpm 此时在/etc/yum.repos.d目录下生成了如下文件: mysql-community.repo mysql-community-source.repo 2、编辑mysql-community.repo文件: [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 需要安装哪个版本就将该项目下的enabled设置为1,其它的设置为0。 3、安装并启动mysql mysql5.6: yum install mysql-community-server service mysqld start 4.设置密码 shell>mysql shell>show databases; shell>use mysql; shell>select user,host from user ; shell>delete from user where user = ''; shell>update user set password=password('123456');//123456 是密码,可以修改成其他的 shell>service mysqld restart//重启服务即可 5、新建用户允许远程访问 grant all privileges on *.* to 'root'@'%' identified by '密码是啥';
linux-快速安装mysql5.6*
最新推荐文章于 2023-12-13 16:44:30 发布