以下是MariaDB官方文档说明,MariaDB如何安装在已经存在MySQL实例的主机上:

https://mariadb.com/kb/en/library/installing-mariadb-alongside-mysql/

但是如果是先安装了MariaDB,然后再安装MySQL,比如:

MariaDB的二进制程序在/opt/mysql/mariadb-10.2.8-linux-x86_64/

/usr/local/做了一个软链接,即

ln -s /opt/mysql/mariadb-10.2.8-linux-x86_64/ mysql

具体见《MariaDB安装》的配置是一样的。

安装时注意

新的MySQL实例的配置文件,比如/etc/my3308.cnf,数据等文件设置在/data/mysql/mysql3308/{data,log,tmp}下。

做的软链接是:

ln -s /opt/mysql/mysql-5.7.19-linux-glibc2.12-x86_64/    mysql5.7

初始化MySQL时,一定要指定配置文件!!

cd /usr/local/mysql5.7
./bin/mysqld --defaults-file=/etc/my3308.cnf --initialize

初始化没有报错,但查看日志却发现有error和多个warning,见最后。

其中有一个错误:

[ERROR] Can't read from messagefile '/opt/mysql/mariadb-10.2.8-linux-x86_64/share/english/errmsg.sys'

在配置文件,加一个参数即可

[mysqld]
language = /usr/local/mysql5.7/share/english

启动

直接使用绝对路径的mysqld来启动

/usr/local/mysql5.7/bin/mysqld --defaults-file=/etc/my3308.cnf &

关闭

直接使用绝对路径的mysqladmin来关闭

/usr/local/mysql5.7/bin/mysqladmin -S /data/mysql/mysql3308/tmp/mysql3308.sock -uroot -p shutdown

扩展

可以把启动/关闭/登录数据库做成shell文件

启动

echo '/usr/local/mysql5.7/bin/mysqld --defaults-file=/etc/my3308.cnf &' > start.sh
chmod +x start.sh

关闭

echo '/usr/local/mysql5.7/bin/mysqladmin -S /data/mysql/mysql3308/tmp/mysql3308.sock -uroot -p1234567 shutdown' > stop.sh
chmod +x stop.sh

登录

echo '/usr/local/mysql5.7/bin/mysql -S /data/mysql/mysql3308/tmp/mysql3308.sock -uroot -p1234567' > login.sh
chmod +x login.sh

这样就实现了MariaDB和MySQL同一个主机上并存。

不过初始化后,错误日志记录有一些警告的信息:

2017-10-25T10:39:08.325682Z 0 [Warning] The syntax '--language/-l' is deprecated and will be removed in a future release. Please use '--lc-messages-dir' instead.
2017-10-25T10:39:08.325842Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-10-25T10:39:08.325937Z 0 [Warning] Using pre 5.5 semantics to load error messages from /usr/local/mysql5.7/share/english/.
2017-10-25T10:39:08.325943Z 0 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2017-10-25T10:39:08.326404Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326414Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326478Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326483Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326547Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326550Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326713Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326717Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326784Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326792Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326839Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326843Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.326895Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.326899Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327097Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327108Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327175Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327184Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327373Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327383Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327432Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327439Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327566Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327578Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327673Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327678Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327762Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327766Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327820Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327824Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327870Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327874Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.327968Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.327972Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328017Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328021Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328082Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328086Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328152Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328156Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328216Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328220Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328291Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328296Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
2017-10-25T10:39:08.328341Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import'
2017-10-25T10:39:08.328345Z 0 [Warning] Unknown LDML tag: 'charsets/charset/collation/rules/import/source'
100
100
100
2017-10-25T10:39:08.912076Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-10-25T10:39:08.965834Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-10-25T10:39:09.024512Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: bb700150-b970-11e7-8e66-0050568a571f.
2017-10-25T10:39:09.025193Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-10-25T10:39:09.026291Z 1 [Note] A temporary password is generated for root@localhost: eiq-<*>yO0k-

MariaDB与MySQL并存的更多相关文章

  1. 【MariaDB】MariaDB vs MySQL - 特性

    原文链接: https://mariadb.com/kb/en/mariadb-vs-mysql-features/ xiaomo译------ 支持更多的存储引擎 除了标配的MyISAM, BLAC ...

  2. centos7 高速安装 mariadb(mysql)

    从最新版本的linux该系统启动,缺省值是 Mariadb代替mysql! 使用系统自带repos安装非常easy: yum install mariadb mariadb-server system ...

  3. MariaDB与MySQL在一台服务器同时运行

    [root@HE3 ~]#groupadd mariadb -g 513 [root@HE3 ~]#useradd-u 513 -gmariadb -s /sbin/nologin -d /home/ ...

  4. mariaDB vs mysql

    mariaDB vs mysql 今天遇到一个库使用的是mariaDB的数据库版本 Server version: 10.1.20-MariaDB MariaDB Server 理了一下mariaDB ...

  5. MariaDB与MySQL

    一.MariaDB安装部署 tar zxvf mariadb-5.5.31-linux-x86_64.tar.gz mv mariadb-5.5.31-linux-x86_64 /usr/local/ ...

  6. MariaDB 和 MySQL 比较

    MariaDB.org - Supporting continuity and open collaborationhttps://mariadb.org/ MariaDB 和 MySQL 比较 - ...

  7. MariaDB MariaDB、MySQL存储过程、游标基础应用举例说明

    MariaDB.MySQL存储过程.游标基础应用举例说明 by:授客 QQ:1033553122 测试环境: MariaDB-10.0.19-centos7-x86_64 实践操作: # 创建测试数据 ...

  8. 数据库对比:选择MariaDB还是MySQL?

    作者 | EverSQL 译者 | 无明 这篇文章的目的主要是比较 MySQL 和 MariaDB 之间的主要相似点和不同点.我们将从性能.安全性和主要功能方面对这两个数据库展开对比,并列出在选择数据 ...

  9. Buildroot MariaDB替代MySQL

    /********************************************************************************* * Buildroot Maria ...

随机推荐

  1. 原生js实现图片预览并上传

    最近主导的PC客户端网站重构工程告一段落,下一阶段开始给公司APP开发H5页面,技术栈是react.最近碰到一个需求:需要在H5页面上添加身份证照片,预览并上传.因为要兼容安卓4.4以下版本的手机,所 ...

  2. MVC使用AdditionalMetadata为Model属性添加额外信息

    当需要为Model的属性添加一些额外信息的时候,使用[AdditionalMetadata("somekey", "some content")]是不错的选择, ...

  3. Android 性能优化之使用MAT分析内存泄露

    转载请注明本文出自xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/42396507),请尊重他人的辛勤劳动成果,谢谢! 我们平常 ...

  4. IE中Ext的comboBox跑到页面左上角

    { xtype:'combo', width:100, //id:'exTypeCom', name:'exType', hiddenName:'exType', displayField:'text ...

  5. 利用localStorage实现对ueditor编辑内容定时保存为草稿

    直接看代码吧 1.引入ueditor和ueditor的使用我就不细说了 详情请戳http://blog.csdn.net/wangdianyong/article/details/39780709 2 ...

  6. 8个免费且实用的C++ GUI库(转载)

      原文链接:http://zoomzum.com/8-free-and-useful-c-gui-libraries/ 作者的话:C++标准中并没有包含GUI,这也使得C++开发图形化界面需要依赖于 ...

  7. easyDarwin--开源流媒体实现

    EasyDarwin 是由国内开源流媒体团队开发和维护的一款开源流媒体平台框架,从2012年12月创建并发展至今,从原有的单服务的流媒体服务器形式,扩展成现在的云平台架构的开源项目,更好地帮助广大流媒 ...

  8. 使用sun.misc.BASE64Decoder出错解决方案

    Access restriction: The type BASE64Decoder is not accessible due to restriction on required library ...

  9. OpenShift上部署Redis主从集群

    客户有部署有状态服务的需求,单机部署模式相对简单,尝试一下集群部署. 关于Redis的master,slave 以及sentinal的架构和作用不提,有兴趣可以参考之前的博客 https://www. ...

  10. @SpringContext通过实现ApplicationContextAware接口动态获取bean

    场景: 在代码中需要动态获取spring管理的bean 目前遇到的主要有两种场景:1.在工具类中需要调用某一个Service完成某一个功能,如DictUtils2.在实现了Runnable接口的任务类 ...