Install binary mariadb on CentOS-6

Source: Internet
Author: User

Objective:

three different forms of packages are available on the official website of MARIADB: Source Package, Package Manager, and binary, as shown in. Binary plate is compiled by the official green version, compared to the source package version installation is more simple than the Package Manager version of a little more freedom, is considered a compromise between the two. Also note that it relies on glibcand needs to be aware of the glibc version.

Installation:

Step One:

First confirm the glibc version, you can see that CentOS-6 is installed on the glibc-2.12 version, so you need to download

# rpm-q Glibcglibc-2.12-1.166.el6.x86_64

Step Two:

Close Iptables and SELinux


Step Three:

# Create System user MySQL

# useradd-r MySQL

# Unzip to directory/usr/local/

# TAR-XF Mariadb-5.5.43-linux-x86_64.tar.gz-c/usr/local/

# Create a soft link mysql

# cd/usr/local/# LN-SV mariadb-5.5.43-linux-x86_64/mysql "MySQL", "mariadb-5.5.43-linux-x86_64/"

# Modify Directory owner and owner group

# Chown-r Root:mysql.

# Create a database directory. Use the data directory in the current directory as the database directory by default if you do not create and specify it separately

# mkdir-pv/data/mysqlmkdir:created directory '/data ' mkdir:created directory '/data/mysql '

# Modify the database directory's owner and host group as MySQL

# Chown-r mysql:mysql/data/mysql/

# Install the database

# scripts/mysql_install_db--user=mysql--datadir=/data/mysql


Configuration

# import the bin directory path to the PATH environment variable

# Vim/etc/profile.d/mysql.shexport Path=/usr/local/mysql/bin: $PATH

# effective immediately

# EXEC Bash

# Create a header file symbolic link

# cd/usr/local/include/# Ln-s. /mysql/include/mysql/mysql

# import man path to System man manual

# Vim/etc/man.configmanpath/usr/local/mysql/man

# Copy Service script to/ETC/RC.D/INIT.D directory

# cd/usr/local/mysql# CP Support-files/mysql.server/etc/rc.d/init.d/mysqld

# Copy template configuration file to/etc/directory

# CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

# Modify configuration file

# VIM/ETC/MY.CNF

Character:

mysqld for server, MySQLfor the local CLIcommand-line tools, clientthe connection tools for the client include remote connection tools, and so on. All need to set the character set uniformly to Utf-8, special scenes are modified to other character sets according to the actual situation.

[Client]default-charater-set=utf8[mysql]default-charater-set=utf8[mysqld]character-set-server=utf8


Character sorting:

[Mysqld]collation-server=utf8_general_ci


Database directory

[Mysqld]datadir=/data/mysql


Storage Engine

[mysqld]# uses the InnoDB storage engine by default default-storage-engine=innodb# each table uses a separate table space innodb-file-per-table=true


Turn off domain name inverse solution

Skip-name-resolve=true


[client]port            = 3306socket           = /TMP/MYSQL.SOCKDEFAULT-CHARACTER-SET=UTF8[MYSQLD] datadir=/data/mysqlport            =  3306socket          = /tmp/ Mysql.sockskip-external-lockingkey_buffer_size = 256mmax_allowed_packet = 1mtable_open_ cache = 256sort_buffer_size = 1mread_buffer_size = 1mread_rnd_buffer_size =  4mmyisam_sort_buffer_size = 64mthread_cache_size = 8query_cache_size= 16mthread _concurrency = 8character-set-server=utf8collation-server=utf8_general_cidefault-storage-engine= innodbinnodb-file-per-table=trueskip-name-resolve=truelog-bin=mysql-binskip-name-resolve=truelog-bin= Mysql-binbinlog_format=mixedserver-id    &nbsP;  = 1[mysqldump]quickmax_allowed_packet = 16m[mysql] no-auto-rehashdefault-character-set=utf8[myisamchk]key_buffer_size = 128msort_buffer_size =  128mread_buffer = 2mwrite_buffer = 2m[mysqlhotcopy]interactive-timeout


Start the service

/etc/init.d/mysqld start

Boot from Boot

Chkconfig--add mysqldchkconfig mysqld on

Security settings

# mysql_secure_installation /usr/local/mysql/bin/mysql_secure_installation: line 379:  find_mysql_client: command not foundNOTE: RUNNING ALL PARTS OF  this script is recommended for all mariadb       servers in production use!  please read each step carefully! In order to log into mariadb to secure it, we ' ll need  The currentpassword for the root user.  if you ' ve just  Installed mariadb, andyou haven ' t set the root password yet, the  password will be blank,so you should just press enter here. #  initial root password is empty, direct carriage return enter current password for root  (enter for none):  ok, successfully uSed password, moving on ... setting the root password ensures that nobody can log into  The mariadbroot user without the proper authorisation. #设置root密码Set  root  password? [y/n] n ... skipping. by default, a mariadb installation has an anonymous user,  allowing anyoneto log into mariadb without having to have a  user account created forthem.  this is intended only for  Testing, and to make the installationgo a bit smoother.  you  should remove them before moving into aproduction environment.#  Delete anonymous user remove anonymous users? [y/n] n ... skipping. Normally, root should only be allowed to connect from  ' localhost ' .  thisensures that someone cannot  guess at the root password from the network.#  does not allow root remote login disallow  root login remotely? [y/n] n ... skipping. by default, mariadb comes with a database named  ' Test '  that  anyone canaccess.  this is also intended only for testing,  and should be removedbefore moving into a production environment.#   Delete the test database and access its permission settings remove test database and access to it? [y/n]  N ... skipping. Reloading the privilege tables will ensure that all changes made  so farwill take effect immediately.#  Overloaded Permissions List Reload privilege tables  now? [y/n] y ... success! Cleaning up ... All done!  if you ' ve completed all of the above steps,  Your mariadbinstallation should now be secure. thanks for using mariadb!


Install binary mariadb on CentOS-6

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.