以下是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. 使用Bootstrap 3开发响应式网站实践03,轮播下方的内容排版

    通常把一些重要信息.需要重点标注的信息放在轮播的下方显示,这部分区域用到了大字体的标题.副标题以及段落文字等. <div class="row" id="bigCa ...

  2. waitdialogform z

    namespace DevExpress.Utils { using DevExpress.LookAndFeel; using DevExpress.Skins; using DevExpress. ...

  3. CHM编写软件

    工具选择 1.         HTML编辑工具:就是用什么软件写文档的问题.一直都是做.NET开发,所以选择HTML编辑也大都在MS阵营里选.主要有以下几种HTML编辑器. (1)       Dr ...

  4. Java网络编程技术1

    1. Java网络编程常用API 1.1 InetAddress类使用示例 1.1.1根据域名查找IP地址 获取用户通过命令行方式指定的域名,然后通过InetAddress对象来获取该域名对应的IP地 ...

  5. Objective-C:保留计数器思想的详解(对象的保留和所有权的释放)

    对象的保留和所有权的释放: int main(int agrs,char *argv[]) { @autoreleasepool{ Person *person = [[Person alloc]in ...

  6. MongoDB学习笔记(三)--权限 && 导出导入备份恢复 && fsync和锁

    权限                                                                                             绑定内网I ...

  7. ComboxEdit 重要属性

    DisplayMember="ComboItemName" ValueMember="ComboItemCode"IsTextEditable="Tr ...

  8. 【Hibernate】Hibernate3.x独立执行时的Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;错误

    按理说,假设Hibernate不依附于SSH执行,像<[Struts2+Hibernate3+Spring3]利用SSH整合,完毕打印用户表,用户登录.注冊.改动password系统>(点 ...

  9. [Backbone]Real Route

    Duplication is Bad. Let's DRY (Don't Repeat Yourself) our routes to make /pp:per_page an optional pa ...

  10. easyui refresh 刷新两次的解决方法(推荐)

    //这样写刷新两次 $("#windowid").window('refresh','url01.php'); $("#windowid").window('o ...