Linux how to install and configure MariaDB database

  

MariaDB is a MySQL branch version of the Maria storage engine, in many ways stronger than MySQL, then how to install MariaDB database under Linux? The following system home Xiaobian will introduce you to the Linux installation and configuration method of MariaDB database.

Description:

Operating System: CentOS 5.10 32-bit

MariaDB Version: mariadb-5.5.33a

MariaDB Database Storage Directory: /data/mysql

Preparation:

First, configure IP, DNS, gateway, ensure that the remote connection tool can be used to connect to the server, the server yum command can be used normally

Second, configure the firewall , open port 3306

vi /etc/sysconfig/iptables #edit

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #Allow 3306 port to pass through the firewall

Special note: Many netizens add these two rules to the last line of the firewall configuration, causing the firewall to fail to start. The correct one should be added to the default 22 port. Below the rules

After adding the firewall rules are as follows:

************************* ************************************************** *******

# Firewall configuration written by system-config-securitylevel

#模型 customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:RH-Firewall-1-INPUT - [0:0]

-A INPUT -j RH-Firewall-1-INPUT

-A FORWARD -j RH-Firewall-1-INPUT

-A RH-Firewall-1-INPUT -i lo -j ACCEPT

-A RH-Firewall-1 -INPUT -p icmp --icmp-type any -j ACCEPT

-A RH-Firewall-1-INPUT -p 50 -j ACCEPT

-A RH-Firewall-1-INPUT -p 51 -j ACCEPT

-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT

-A RH-Firewall-1- INPUT -p udp -m udp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A RH-Firewall- 1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host- Prohibited

COMMIT

************************************ **********************************************

/etc/init.d/iptables restart # Finally restart the firewall to make the configuration effective

Third, close SELINUX

vi /etc/selinux/config

#SELINUX= Enforcing # comment

#SELINUXTYPE=targeted # comment out

SELINUX=disabled #增

:wq! #SaveExit

shutdown -r now #restart the system
Previous12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved