Install MariaDB on CentOS 6.5
1. software environment:
CentOS 6.5x64
MariaDB 5.5.36
2. Installation Process
1) Create the MariaDB. repo file in the/etc/yum. repos. d/directory. The content is as follows:
# MariaDB 5.5 CentOS repository list-created UTC
# Http://mariadb.org/mariadb/repositories/
[Mariadb]
Name = MariaDB
Base url = http://yum.mariadb.org/5.5/centos6-amd64
Gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Gpgcheck = 1
2) execute commands in the Shell Environment
# Yum install MariaDB-server MariaDB-client
Loaded plugins: fastestmirror, security
Base | 3.7 kB
Base/primary_db | 4.4 MB
Extras | 3.4 kB: 00
Extras/primary_db | 19 kB: 00
Mariadb | 1.9 kB: 00
Mariadb/primary_db | 15 kB: 00
Updates | 3.4 kB: 00
Updates/primary_db | 2.1 MB
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64. 5.36-1. el6 will be obsoleting
--> Processing Dependency: MariaDB-common for package: MariaDB-client-5.5.36-1.el6.x86_64
---> Package MariaDB-server.x86_64. 5.36-1. el6 will be obsoleting
---> Package mysql. x86_64. 1.71-1. el6 will be obsoleted
---> Package mysql-server.x86_64. 1.71-1. el6 will be obsoleted
--> Running transaction check
---> Package MariaDB-common.x86_64. 5.36-1. el6 will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-5.5.36-1.el6.x86_64
--> Running transaction check
---> Package MariaDB-compat.x86_64. 5.36-1. el6 will be obsoleting
---> Package mysql-libs.x86_64. 1.71-1. el6 will be obsoleted
--> Finished Dependency Resolution
Dependencies Resolved
========================================================== ========================================================== ========================================
Package Arch Version Repository Size
========================================================== ========================================================== ========================================
Installing:
MariaDB-client x86_64 5.5.36-1. el6 mariadb 10 M
Replacing mysql. x86_64 5.1.71-1. el6
MariaDB-compat x86_64 5.5.36-1. el6 mariadb 2.7 M
Replacing mysql-libs.x86_64 5.1.71-1. el6
MariaDB-server x86_64 5.5.36-1. el6 mariadb 42 M
Replacing mysql-server.x86_64 5.1.71-1. el6
Installing for dependencies:
MariaDB-common x86_64 5.5.36-1. el6 mariadb 23 k
Transaction Summary
========================================================== ========================================================== ========================================
Install 4 Package (s)
Total download size: 55 M
Is this OK [y/N]: y
Downloading Packages:
(1/4): MariaDB-5.5.36-centos6-x86_64-client.rpm | 10 MB
(2/4): MariaDB-5.5.36-centos6-x86_64-common.rpm | 23 kB
(3/4): MariaDB-5.5.36-centos6-x86_64-compat.rpm | 2.7 MB
(4/4): MariaDB-5.5.36-centos6-x86_64-server.rpm | 42 MB
Bytes ------------------------------------------------------------------------------------------------------------------
Total 40 kB/s | 55 MB 23: 34
Warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
Userid: "Daniel Bartholomew (Monty Program signing key) <dbart@askmonty.org>"
From: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Is this OK [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: MariaDB-compat-5.5.36-1.el6.x86_64 1/7
Installing: MariaDB-common-5.5.36-1.el6.x86_64 2/7
Error in PREIN scriptlet in rpm package MariaDB-server-5.5.36-1.el6.x86_64
**************************************** **************************
A MySQL or MariaDB server package (mysql-server-5.1.71-1.el6.x86_64) is installed.
The current MariaDB server package is provided by a different
Vendor (CentOS) than Monty Program AB. Some files may be installed
To different locations, including log files and the service
Startup script in/etc/init. d /.
Upgrading directly from MySQL 5.1 to MariaDB 5.5 may not
Be safe in all cases. A manual dump and restore using mysqldump is
Recommended. It is important to review the MariaDB manual's Upgrading
Section for version-specific incompatibilities.
A manual upgrade is required.
-Ensure that you have a complete, working backup of your data and my. cnf
Files
-Shut down the MySQL server cleanly
-Remove the existing MySQL packages. Usually this command will
List the packages you shoshould remove:
Rpm-qa | grep-I '^ mysql -'
You may choose to use 'rpm -- nodeps-ev <package-name> 'to remove
The package which contains the mysqlclient shared library.
Library will be reinstalled by the MariaDB-shared package.
-Install the new MariaDB packages supplied by Monty Program AB
-Ensure that the MariaDB server is started
-Run the 'mysql _ upload' program
This is a brief description of the upgrade process. Important details
Can be found in the MariaDB manual, in the Upgrading section.
**************************************** **************************
Error: % pre (MariaDB-server-5.5.36-1.el6.x86_64) scriptlet failed, exit status 1
Error: install: % pre scriptlet failed (2), skipping MariaDB-server-5.5.36-1.el6
Installing: MariaDB-client-5.5.36-1.el6.x86_64 4/7
Erasing: mysql-5.1.71-1.el6.x86_64 5/7
Erasing: mysql-libs-5.1.71-1.el6.x86_64 6/7
Verifying: MariaDB-common-5.5.36-1.el6.x86_64 1/7
Verifying: MariaDB-compat-5.5.36-1.el6.x86_64 2/7
Verifying: MariaDB-client-5.5.36-1.el6.x86_64 3/7
Verifying: mysql-libs-5.1.71-1.el6.x86_64 4/7
Verifying: MariaDB-server-5.5.36-1.el6.x86_64 5/7
Mysql-server-5.1.71-1.el6.x86_64 was supposed to be removed but is not!
Verifying: mysql-server-5.1.71-1.el6.x86_64 6/7
Verifying: mysql-5.1.71-1.el6.x86_64 7/7
Installed:
MariaDB-client.x86_64 0: 5. 5.36-1. el6 MariaDB-compat.x86_64 0: 5. 5.36-1. el6
Dependency Installed:
MariaDB-common.x86_64. 5.36-1. el6
Replaced:
Mysql. x86_64. 1.71-1. el6 mysql-libs.x86_64. 1.71-1. el6
Failed:
MariaDB-server.x86_64 0: 5. 5.36-1. el6 mysql-server.x86_64 0: 5. 1.71-1. el6
Complete!
3. Start MariaDB
#/Etc/init. d/mysqld start
Initializing MySQL database: WARNING: The host 'cloud-Q2 'cocould not be looked up with resolveip.
This probably means that your libc libraries are not 100% compatible
With this binary MySQL version. The MySQL daemon, mysqld, shocould work
Normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
When specifying MySQL privileges!
Installing MySQL system tables...
OK
Filling help tables...
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 MySQL root USER!
To do so, start the server, then issue the following commands:
/Usr/bin/mysqladmin-u root password 'new-password'
/Usr/bin/mysqladmin-u root-h Cloud-Q2 password 'new-password'
Alternatively you can run:
/Usr/bin/mysql_secure_installation
Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon:
Cd/usr;/usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
Mysql-test-run.pl for cd/usr/mysql-test; perl
Please report any problems with the/usr/bin/mysqlbug script!
[OK]
Starting mysqld: [OK]
4. Set a password for MariaDB
#/Usr/bin/mysqladmin-u root password 'adminadmin'
Log onto MariaDB
MySQL [(none)]> use mysql;
MySQL [mysql]> update user set host = '%' where user = 'root' and host = '2017. 0.0.1 ';
MySQL [mysql]> grant all privileges on *. * to 'root' @ '%' identified by 'adminadmin' with grant option;
MySQL [mysql]> flush privileges;
5. Allow the firewall to pass port 3306
# Vi/etc/sysconfig/iptables
Add the following content:
-A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
Save and exit editing
Restart the Firewall Service
# Service iptables restart
Remote Connection check. Everything is OK!
Install LAMP (Apache with MariaDB and PHP) in CentOS/RHEL/Scientific Linux 6)
Implementation of MariaDB Proxy read/write splitting
How to compile and install the MariaDB database in Linux
Install MariaDB database using yum in CentOS
Install MariaDB and MySQL
How to migrate MySQL 5.5 database to MariaDB 10 on Ubuntu
Install MariaDB on the Ubuntu 14.04 (Trusty) Server