LAMP+NFS installation of MARIADB

Source: Internet
Author: User

MariaDB is installed based on a two-mechanism package and does not require compilation

First, data disk preparation

we put another disk on the virtual machine, the size of their own, here is 2G

650) this.width=650; "src=" Http://l51cto.qiniudn.com/mariadb1.png "width=" 629 "height=" 407 "alt=" Mariadb1.png "/>

Creating partitions

To view the newly added disk location

[[email protected]~]# fdisk -l disk /dev/sda: 137.4 gb, 137438953472  bytes255 heads, 63 sectors/track, 16709 cylindersunits = cylinders  of 16065 * 512 = 8225280 bytesSector size  (logical/physical):  512 bytes / 512 bytesI/O size  (Minimum/optimal): 512 bytes  / 512 bytesdisk identifier: 0x000188e2    device boot       Start         End       Blocks  Id  System/dev/sda1   *            1          26       204800  83  LinuxPartition 1 does not  End on cylinder&nBsp;boundary./dev/sda2              26         7859   62914560   8e   linux lvm disk /dev/sdb: 2147 mb, 2147483648 bytes255 heads, 63  sectors/track, 261 cylindersunits = cylinders of 16065 * 512  = 8225280 bytesSector size  (logical/physical):  512 bytes / 512  bytesI/O size  (Minimum/optimal): 512 bytes / 512 bytesdisk  identifier: 0x00000000

650) this.width=650; "src=" Http://l51cto.qiniudn.com/mariadb2.png "width=" 660 "height=" 455 "alt=" Mariadb2.png "/>

we are using the LV logical volume, so to choose the type, most do not forget to save the partition 650) this.width=650; "Src=" http://l51cto.qiniudn.com/ Mariadb3.png "width=" 660 "height=", "alt=, Mariadb3.png"/>

Completed created

650) this.width=650; "src=" Http://l51cto.qiniudn.com/mariadb4.png "width=" 658 "height=" 235 "alt=" Mariadb4.png "/>

Create logical volume, size 2G hint space is not enough, perhaps the calculation method is different, you have to use 1.99G

Creating a file system

[[email protected]~]# mkfs.xfs /dev/myvg/mylvmeta-data=/dev/myvg/mylv          isize=256    agcount=4, agsize=130560 blks          =                        sectsz=512   attr =2, projid32bit=0data     =                        bsize=4096    blocks=522240, imaxpct=25         =                         sunit=0      swidth=0 blksnaming   = version 2   &Nbsp;          bsize=4096   ascii-ci=0log       =internal log            bsize=4096   blocks=2560, version=2          =                        sectsz=512   sunit=0 blks, lazy-count= 1realtime =none                    extsz=4096   blocks=0, rtextents=0

Modify The/etc/fstab file to automatically mount the boot

650) this.width=650; "width=" 660 "height=" 168 "src=" Http://l51cto.qiniudn.com/mariadb5.png "style=" border:1px Solid RGB (221,221,221); width:660px;height:168px;background:no-repeat 50% 50%; "alt=" spacer.gif "border=" 0 "hspace=" 0 " Vspace= "0" title= ""/>

Create mount Directory

[[Email protected]~]# mkdir/data

Test whether automatic mount is in effect

[[email protected] ~]# mount-a[[email protected] ~]# mount/dev/mapper/vg0-root on/type ext4 (rw) proc On/proc type proc (rw) Sysfs On/sys type SYSFS (rw) devpts on/dev/pts type devpts (rw,gid=5,mode=620) Tmpfs on/dev/shm type TMPFS (rw)/dev/ SDA1 on/boot type EXT4 (rw)/dev/mapper/vg0-usr on/usr type EXT4 (rw)/dev/mapper/vg0-var On/var type EXT4 (rw) None on/p Roc/sys/fs/binfmt_misc type Binfmt_misc (rw)/dev/mapper/myvg-mylv on/data type XFS (rw)//Mounted

Create a database directory

[Email protected] ~]# Mkdir/data/mysql

Create System user group MySQL, system user MySQL, and change/data/mysql/genera Group are MySQL

[Email protected]~]# groupadd-r mysql[[email protected]~]# useradd-r-G mysql-s/sbin/nologin Mysql[[email protected]~ ]# Chown-r mysql:mysql/data/

Installing the MARIADB binary program

[Email protected]~]# tar XF mariadb-5.5.36-linux-i686.tar.gz-c/usr/local///Unzip to installation directory [[email protected] ~]# CD   /usr/local/[[email protected] local]# Lsbin etc games include Lib Lib64 libexec mariadb-5.5.36-linux-i686 sbin Share Src[[email protected] local]# LN-SV mariadb-5.5.36-linux-i686/mysql//Create soft link ' MySQL '--' mariadb-5.5.36-linux-i686/'

Configure MARIADB

[Email protected] local]# cd/usr/local/mysql[[email protected] mysql]# scripts/mysql_install_db--user= Mysql--datadir=/data/mysql//Run initialization script, indicate run as user MySQL, database directory is/data/mysql

Provide a configuration file for mariadb, and modify the value of thread_concurrency in this file by multiplying your number of CPUs by 2, specifying the MySQL database to hold the data location, for example using the following line:

[email protected] mysql]# CP support-files/my-large.cnf/etc/mysql.cnf

650) this.width=650; "width=" 660 "height=" "src=" "Http://l51cto.qiniudn.com/mariadb6.png" alt= "Spacer.gif" border= " 0 "hspace=" 0 "vspace=" 0 "title=" "style=" border:1px solid rgb (221,221,221); width:660px;height:87px; background-position:50% 50%;background-repeat:no-repeat; "/>

Add a service script for MySQL

[[email protected] mysql]# CP support-files/mysql.server/etc/rc.d/init.d/mysqld[[email protected] mysql]# chmod +x/etc /rc.d/init.d/mysqld[[email protected] mysql]# chkconfig--add mysqld

and follow the modified installation path, data path, and configuration file path 650) this.width=650; "width=" 660 "height=" "src=" Http://l51cto.qiniudn.com/mariadb7.png " alt= "Spacer.gif" border= "0" hspace= "0" vspace= "0" title= "style=" border:1px solid rgb (221,221,221); width:660px; height:45px;background-position:50% 50%;background-repeat:no-repeat; "/>650) this.width=650; width=" 660 "height = "src=" "Http://l51cto.qiniudn.com/mariadb8.png" alt= "spacer.gif" border= "0" hspace= "0" vspace= "0" title= "" style= " border:1px solid RGB (221,221,221); width:660px;height:92px;background-position:50% 50%;background-repeat:no-repeat ; "/>

Export MySQL Environment variables

[Email protected] ~]# vim/etc/profile.d/mysql.sh

650) this.width=650; "width=" 660 "height=" "src=" Http://l51cto.qiniudn.com/mariadb9.png "alt=" Spacer.gif "border=" 0 "hspace=" 0 "vspace=" 0 "title=" "style=" border:1px solid rgb (221,221,221); width:660px;height:50px; background-position:50% 50%;background-repeat:no-repeat; "/>

Make environment variables effective

[Email protected] mysql]#. /etc/profile.d/mysql.sh

At this point the configuration is complete, you can use the service script to start the 650) this.width=650; "width=" 660 "height=" "src=" alt= "Spacer.gif" border= "0" hspace= "0" vspace= "0" title= "style=" text-indent:28px;border:1px solid rgb (221,221,221); width:660px;height:63px;background-position:50% 50%;background-repeat:no-repeat; "/>

Startup success

Enter database command line

650) this.width=650; "src=" Http://l51cto.qiniudn.com/mariadb11.png "width=" 660 "height=" 206 "alt=" Mariadb11.png "/ >

This article is from the "Linux Learning path" blog, so be sure to keep this source http://linuxu.blog.51cto.com/9471357/1596998

LAMP+NFS installation of MARIADB

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.