Installing MariaDB with centos


For CentOS, RedHat, and Fedora, it is highly recommended to install from a repository using yum. This page walks you through the simple steps.

Adding the MariaDB YUM Repository

We currently have repositories for CentOS 5, CentOS 6, RHEL 5, RHEL 6, Fedora 16, and Fedora 17.

Once you have your MariaDB.repo entry, add it to a file under /etc/yum.repos.d/. (We suggest something like /etc/yum.repos.d/MariaDB.repo.)

An example MariaDB.repo

Create MariaDB repository

#vi /etc/yum.repos.d/mariadb

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

(save & exit)

yum -y update

Installing MariaDB

With the repo file in place you can now install MariaDB like so:

sudo yum install MariaDB-server MariaDB-client
service mysql start
chkconfig –levels 235 mysql on
/usr/bin/mysql_secure_installation

Enter current password for root (enter for none):  (Enter)
Set root password? [Y/n] y    (type password)
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Thanks for using MariaDB!

mysql -u root -p

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

service iptables restart

configure database from remote access through mariadb

login in mysql e.g. # mysql -u root -p

MariaDB [(none)]> GRANT ALL PRIVILEGES ON . TO ‘root’@’192.168.1.%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;

MariaDB [(none)]> SELECT User, Host FROM mysql.user WHERE Host <> ‘localhost’;

MariaDB [(none)]> exit

veryfiy from remote connectivity

in remote machine open terminal

$ telenet <IP Address > <port i.e 3306>

output:
Trying <IP Address>…
Connected to <IP Address>.
Escape character is ‘^]’.
Y
5.5.5-10.0.14-MariaDB
l[b])TJ ?� T$SV7Oh@Co(smysql_native_passwordConnection closed by foreign host.

Thank you…

Leave a comment