官方会提示,请不要在生产环境使用beta和alpha版本的数据库。
他们的主要功能一般是用来测试和排错,所以不稳定。
这里我们选择安装一个10.0系列的Stable的数据库。
我们打算在安装之后,连接刚才10.1的数据库并插入语句。
(2)选择二进制格式的安装方式
mariadb-10.0.28-linux-x86_64.tar.gz gzipped tar file Linux x86_64 317.3 MB MD5 SHA1 Signature Instructions
根据CPU和系统,我们选择安装这个包。
官方编译好的二进制包都是tar.gz格式的,不过注意不要安装到源码包。
(3)解压缩文件并创建软连接。
[root@node2 ~]# tar -xf mariadb.tar.gz -C /usr/local/ [root@node2 ~]# cd /usr/local/ [root@node2 local]# ln -sv mariadb-10.0.28-linux-x86_64/ mysql ‘mysql’ -> ‘mariadb-10.0.28-linux-x86_64/’为什么要做软连接呢?
一是因为以后我们以后安装其他版本的时候方便一点点。
二是名字够简短,容易辨认。
(4)把mysql的执行文件路径导出到工作路径
(5)创建用户,修改文件权限,并创建数据存放目录
[root@node2 mysql]# useradd -r mysql [root@node2 mysql]# id mysql uid=996(mysql) gid=994(mysql) groups=994(mysql) [root@node2 mysql]# chown mysql.mysql /usr/local/mysql/* -R [root@node2 mysql]# mkdir /datadir [root@node2 mysql]# chown mysql.mysql -R /datadir/创建用户和数据存放目录是为了一会儿初始化的时候准备。
而且mysql有一个常见问题就是,权限不对就启动不成功,所以要注意。
(6)初始化数据库
[root@node2 ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/datadir --basedir=/usr/local/mysql Installing MariaDB/MySQL system tables in '/datadir' ... 161210 8:43:23 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 161210 8:43:23 [Note] /usr/local/mysql/bin/mysqld (mysqld 10.0.28-MariaDB) starting as process 3139 ... 161210 8:43:23 [Note] InnoDB: Using mutexes to ref count buffer pool pages 161210 8:43:23 [Note] InnoDB: The InnoDB memory heap is disabled 161210 8:43:23 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 161210 8:43:23 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 161210 8:43:23 [Note] InnoDB: Compressed tables use zlib 1.2.3 161210 8:43:23 [Note] InnoDB: Using Linux native AIO 161210 8:43:23 [Note] InnoDB: Using CPU crc32 instructions 161210 8:43:23 [Note] InnoDB: Initializing buffer pool, size = 128.0M 161210 8:43:23 [Note] InnoDB: Completed initialization of buffer pool 161210 8:43:23 [Note] InnoDB: Highest supported file format is Barracuda. 161210 8:43:23 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463 161210 8:43:23 [Note] InnoDB: Database was not shutdown normally! 161210 8:43:23 [Note] InnoDB: Starting crash recovery. 161210 8:43:23 [Note] InnoDB: Reading tablespace information from the .ibd files... 161210 8:43:23 [Note] InnoDB: Restoring possible half-written data pages 161210 8:43:23 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 1606610 161210 8:43:23 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 161210 8:43:24 [Note] InnoDB: 128 rollback segment(s) are active. 161210 8:43:24 [Note] InnoDB: Waiting for purge to start 161210 8:43:24 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.32-79.0 started; log sequence number 1606610 161210 8:43:24 [Note] Recovering after a crash using mysql-bin 161210 8:43:24 [Note] Starting crash recovery... 161210 8:43:24 [Note] Crash recovery finished. 161210 8:43:24 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist 161210 8:43:24 [Note] InnoDB: FTS optimize thread exiting. 161210 8:43:24 [Note] InnoDB: Starting shutdown... 161210 8:43:25 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool 161210 8:43:27 [Note] InnoDB: Shutdown completed; log sequence number 1622831 OK Filling help tables... 161210 8:43:27 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 161210 8:43:27 [Note] /usr/local/mysql/bin/mysqld (mysqld 10.0.28-MariaDB) starting as process 3169 ... 161210 8:43:27 [Note] InnoDB: Using mutexes to ref count buffer pool pages 161210 8:43:27 [Note] InnoDB: The InnoDB memory heap is disabled 161210 8:43:27 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 161210 8:43:27 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 161210 8:43:27 [Note] InnoDB: Compressed tables use zlib 1.2.3 161210 8:43:27 [Note] InnoDB: Using Linux native AIO 161210 8:43:27 [Note] InnoDB: Using CPU crc32 instructions 161210 8:43:27 [Note] InnoDB: Initializing buffer pool, size = 128.0M 161210 8:43:27 [Note] InnoDB: Completed initialization of buffer pool 161210 8:43:27 [Note] InnoDB: Highest supported file format is Barracuda. 161210 8:43:27 [Note] InnoDB: 128 rollback segment(s) are active. 161210 8:43:27 [Note] InnoDB: Waiting for purge to start 161210 8:43:27 [Note] InnoDB: Percona XtraDB () 5.6.32-79.0 started; log sequence number 1622831 161210 8:43:27 [Note] InnoDB: FTS optimize thread exiting. 161210 8:43:27 [Note] InnoDB: Starting shutdown... 161210 8:43:28 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool 161210 8:43:30 [Note] InnoDB: Shutdown completed; log sequence number 1622841 OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! To do so, start the server, then issue the following commands: '/usr/local/mysql/bin/mysqladmin' -u root password 'new-password' '/usr/local/mysql/bin/mysqladmin' -u root -h node2.bc.com password 'new-password' Alternatively you can run: '/usr/local/mysql/bin/mysql_secure_installation' which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the MariaDB Knowledgebase at or the MySQL manual for more instructions. You can start the MariaDB daemon with: cd '/usr/local/mysql' ; /usr/local/mysql/bin/mysqld_safe --datadir='/datadir' You can test the MariaDB daemon with mysql-test-run.pl cd '/usr/local/mysql/mysql-test' ; perl mysql-test-run.pl Please report any problems at The latest information about MariaDB is available at You can find additional information about the MySQL part at: Support MariaDB development by buying support/new features from MariaDB Corporation Ab. You can contact us about this at sales@mariadb.com. Alternatively consider joining our community based development effort: