以下是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. Get started with IDA and disassembly SH7058

    http://www.romraider.com/forum/viewtopic.php?f=25&t=6303 All of the 16-bit guidance in the follo ...

  2. 图片未完成加载显示loading

    <html> <title>js图片未加载完显示loading效果</title> <body> <style> img{float:lef ...

  3. spring Annotation 组件注入

    spring 注解的分类 启动spring自己主动扫描功能 <context:component-scan/> 1.@Repository: 它用于将数据訪问层 (DAO 层 ) 的类标识 ...

  4. nginx: [emerg] "proxy_cache_path" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:43

    1.它只能使用于http{  }部分,把proxy_cache_path放置于http部分即可解决此问题.注意图示的上下文

  5. seqgan leakgan

    seqgan https://blog.csdn.net/yinruiyang94/article/details/77675586 leakgan https://www.leiphone.com/ ...

  6. 第一章 mac下开发环境的配置

    mac系统与Linux系统差不多,但是与windows系统版本非常不同. 1.jdk 安装与卸载:https://docs.oracle.com/javase/8/docs/technotes/gui ...

  7. go语言之进阶篇指针类型和普通类型的方法集

    方法集 类型的方法集是指可以被该类型的值调用的所有方法的集合. 用实例实例 value 和 pointer 调用方法(含匿名字段)不受方法集约束,编译器编总是查找全部方法,并自动转换 receiver ...

  8. Log 日志工具类 保存到文件 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  9. 怎样在Ubuntu中修改默认程序

    这个新手指南会向你展示如何在 Ubuntu Linux 中修改默认程序.对于我来说,安装 VLC 多媒体播放器是安装完 Ubuntu 16.04 该做的事中最先做的几件事之一.为了能够使我双击一个视频 ...

  10. N年的经验在别人眼里是怎么看的?

    很多人简历上都喜欢总结这么一句话:N年XXX领域的经验.N值越大,似乎越NB. 可是,我怎么看到很多人做了几十年的饭,水平变化不大,和专业厨师还是差得远. 还有写一辈子字的,开一辈子车的,这些人也和专 ...