标签:
[root@localhost /]# mysqldump --all-databases --user=root --password --master-data > backupdatabase.sql #备份原数据库
Enter password:
mysqldump: Error: Binlogging on server not active #提示启动过日志
[root@localhost /]# vi /etc/my.cnf # [mysqld] 添加 log-bin = mysql-bin 启动日志功能
[root@localhost /]# service mysqld stop # centos6 chkconfig mysqld off centos7 [root@localhost ~]# systemctl disable mysqld.service 删除开机启动
第三步:卸载mysql:
1
|
[root@server ~] # yum remove mysql* mysql-server mysql-devel mysql-libs |
上面的命令将你当前MySQL的配置文件/etc/my.cnf文件到/etc/my.cnf.rpmsave进行备份。
第四步:安装REMI存储库,以解决MySQL的兼容性问题
你可能会得到在安装MariaDB的依赖关系错误。因此,让我们添加REMI存储库来解决依赖性问题。感谢AskMonty知识库帮我解决依赖关系问题。
1
|
[root@server ~] # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
这一步提示错误
[root@localhost ~]# rpm -ivh remi-release-6.rpm 警告:remi-release-6.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 00f97f56: NOKEY
错误:依赖检测失败:
epel-release >= 6 被 remi-release-6.5-1.el6.remi.noarch 需要
[root@localhost ~]# wget ftp://ftp.pbone.net/mirror/dl.iuscommunity.org/pub/ius/archive/Redhat/6/i386/epel-release-6-5.noarch.rpm #下载epel-release
[root@localhost ~]# rpm -ivh epel-release-6-5.noarch.rpm
[root@localhost ~]# rpm -ivh remi-release-6.rpm #解决
现在安装compat-mysql55包:
1
|
[root@server ~] # yum --enablerepo=remi-test --disablerepo=remi install compat-mysql55 |
第五步:安装Mariadb:
创建一个库文件为MariaDB的,并添加以下几行:
对于32位系统:
1
2
3
4
5
6
7
8
|
[root@server ~] # vi /etc/yum.repos.d/mariadb.repo # MariaDB 5.5 CentOS repository list - created # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http: //yum .mariadb.org /5 .5 /centos6-x86 gpgkey=https: //yum .mariadb.org /RPM-GPG-KEY-MariaDB gpgcheck=1 |
对于64为系统:
1
2
3
4
5
6
7
|
[root@server ~] # vi /etc/yum.repos.d/mariadb.repo # MariaDB 5.5 CentOS repository list # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http: //yum .mariadb.org /5 .5 /centos6-amd64 gpgkey=https: //yum .mariadb.org /RPM-GPG-KEY-MariaDB gpgcheck=1 |
保存并退出运行
1
|
#yum update |
下载开始安装Mariadb:
1
|
[root@server ~] # yum install MariaDB-devel MariaDB-client MariaDB-server -y |
安装过程提示冲突, yum remove mysql-community-common 卸载后接着上面的安装就成功了
第六步:启动Mariadb服务
1
2
3
|
[root@server ~] # service mysql start Starting MySQL...... SUCCESS! [root@server ~] # chkconfig mysql on |
标签:
原文地址:http://www.cnblogs.com/hanxing/p/4417179.html