Installing MARIADB (MySQL) in centos6.5

Source: Internet
Author: User

    1. Get MARIADB's installation package pass xftp to the root directory on the website

2. Expand the Mariadb file

  tar xf mariadb-5.5.42-linux-x86_64.tar.gz -C /usr/local

3. Help document Location

/usr/local/mariadb-5.5.42-linux-x86_64/install-binary

4. Preparing the hard disk for database data

  fdisk /dev/sdb

  pvcreate /dev/sdb1

  vgcreate mysqlvg /dev/sdb1

  lvcreate -l 1278 -n mydata mysqlvg

  mke2fs -t ext4 -L MYDATA -b 4096 -m 3 /dev/mysqlvg/mydata

  mkdir /mydata

  vim /etc/fstab

  mount -a

5. Adding MySQL groups and users

  # groupadd -r mysql

  # useradd -g mysql -r mysql

  # id mysql

  uid=498(mysql) gid=498(mysql) groups=498(mysql)

6. Change the genus/mydata/data of the main group

  # chown -R mysql.mysql /mydata/data

7. Make a soft link to the MySQL folder

  # ln -sv mariadb-5.5.42-linux-x86_64 mysql

8. Change the owner group permissions for all files within the MySQL folder

  # chown -R root.mysql ./*

9. Copy the configuration file

MySQL file under Support my-*.cnf is the MySQL profile template, according to the memory size of the non-pass template

650) this.width=650; "title=" 6D134D00-B88E-475A-8DB7-30CC7CA455A1 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" 6d134d00-b88e-475a-8db7-30cc7ca455a1 "src=" http:// S3.51cto.com/wyfs02/m00/59/f6/wkiom1txlbygvwhfaadwapeu0zy455.jpg "width=" 696 "height=" "/>"

Because the MySQL library is installed by default when the system is installed, there will be a MySQL profile. It is recommended to create a new folder to put the template inside.

# mkdir/etc/mysql # cp SUPPORT-FILES/MY-LARGE.CNF/ETC/MYSQL/MY.CNF # VIM/ETC/MYSQL/MY.CNF

Fill in the configuration file with the data file directory

650) this.width=650; "title=" 580e4efb-43b2-43df-8749-323838f0133d "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" 580e4efb-43b2-43df-8749-323838f0133d "src=" http:// S3.51cto.com/wyfs02/m00/59/f2/wkiol1txlsqqhafdaagsyaoisa4012.jpg "width=" 624 "height=" 325 "/>

10. Initializing the database

  # cd /usr/local/mysql/scripts

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

After the MySQL database initialization is complete, you can see that the MySQL data file was generated in the specified location. The MySQL service detects that a configuration file is found in several different locations, merging parameters of several different files, whichever is the last. So here MySQL uses the configuration file is/etc/ Mysql/my.cnf rather than/etc/my.cnf.

650) this.width=650; "title=" 96f4c5c3-1b9d-44d7-9229-39d215f4b804 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" 96f4c5c3-1b9d-44d7-9229-39d215f4b804 "src=" http:// S3.51cto.com/wyfs02/m01/59/f6/wkiom1txlbyt6-lkaacyuvhzku0279.jpg "width=" 687 "height="/>

11. Replication Service Scripts

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

650) this.width=650; "title=" 64185a30-3c9e-4e2c-b619-225858426d75 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" 64185a30-3c9e-4e2c-b619-225858426d75 "src=" http:// S3.51cto.com/wyfs02/m02/59/f6/wkiom1txlbyzfjekaab3oxxw3fm683.jpg "width=" 636 "height=" "/>"

Add the Mysqld service to the list of services

# chkconfig--add mysqld

650) this.width=650; "title=" 94aa08b1-e680-40bd-ac1f-696f3b8b5a39 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" 94aa08b1-e680-40bd-ac1f-696f3b8b5a39 "src=" http:// S3.51cto.com/wyfs02/m00/59/f6/wkiom1txlbydw_ciaabe4assokm530.jpg "width=" 635 "height="/>

12. Start the service

Can see MySQL boot success, 3306 port has been listening

650) this.width=650; "title=" C41ec895-d12d-43e2-8d91-9913b80bee89 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px;width:700px;height:223px; "border=" 0 "alt=" C41ec895-d12d-43e2-8d91-9913b80bee89 "src=" http://s3.51cto.com/wyfs02/M01/59/F2/ Wkiol1txlsrsbqgaaahi2ob0zq8920.jpg "width=" "height=" 223 "hspace=" 0 "vspace=" 0 "/>

13. Add MySQL script to path

# vim/etc/profile.d/mysql.sh

650) this.width=650; "title=" Ddcdbe81-296e-4549-ab0e-e5a13500f3af "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px; "border=" 0 "alt=" ddcdbe81-296e-4549-ab0e-e5a13500f3af "src=" http:// S3.51cto.com/wyfs02/m02/59/f2/wkiol1txlsubczaaaaa22tal-me508.jpg "width=" 370 "height=" "/>"

After source a mysql.sh file, found that using the MySQL command can connect to the MARIADB version of 5.5.42

650) this.width=650; "title=" 45551979-97d3-4bb9-86d9-a5e05ba09b48 "style=" border-right-width:0px; border-bottom-width:0px;border-top-width:0px;width:700px;height:202px; "border=" 0 "alt=" 45551979-97D3-4BB9-86D9-A5E05BA09B48 "src=" http://s3.51cto.com/wyfs02/M00/59/F2/ Wkiol1txlsvz-576aaghianctdq917.jpg "width=" "height=" 202 "hspace=" 0 "vspace=" 0 "/>

This article is from the "Bran" blog, make sure to keep this source http://branguo.blog.51cto.com/9768383/1615881

Installing MARIADB (MySQL) in centos6.5

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.