Binary installation of MariaDB5.5.36
Binary installation of MariaDB5.5.36
1. Obtain the source code package and decompress it. Make sure mysql-server and mysql of the rpm package are not installed.
[Root @ http1 mysql] # rpm-qa mysql
[Root @ http1 mysql] # rpm-qa mysql-server
[Root @ http1 ~] # Ls
Anaconda-ks.cfg apr-util-1.5.3.tar.bz2 install. log
Apr-1.5.0 httpd24 install. log. syslog
Apr-1.5.0.tar.bz2 httpd-2.4.9 mariadb-5.5.36-linux-x86_64.tar.gz
Apr-util-1.5.3 httpd-2.4.9.tar.bz2
[Root @ http1 ~] # Tar xf mariadb-5.5.36-linux-x86_64.tar.gz
[Root @ http1 ~] # Ls
Anaconda-ks.cfg apr-util-1.5.3.tar.bz2 install. log
Apr-1.5.0 httpd24 install. log. syslog
Apr-1.5.0.tar.bz2 httpd-2.4.9 mariadb-5.5.36-linux-x86_64
Apr-util-1.5.3 httpd-2.4.9.tar.bz2 mariadb-5.5.36-linux-x86_64.tar.gz
2. Move to the program installation directory and create a soft link
[Root @ http1 ~] # Music mariadb-5.5.36-linux-x86_64/usr/local
[Root @ http1 ~] # Cd/usr/local/
# Ln-s mariadb-5.5.36-linux-x86_64/mysql
3. Create a mysql master Group
[Root @ http1 local] #/usr/sbin/groupadd-r mysql
[Root @ http1 local] #/usr/sbin/useradd-r-g mysql
4. Create a data storage directory
Format the disk and set it to LVM.
[Root @ http1 mysql] # echo "p \ nn \ np \ n3 \ n + 30G \ nt \ n3 \ n8e \ nw" | fdisk/dev/sda
[Root @ http1 mysql] # partx-a/dev/sda
Create an LVM volume group and logical volume
[Root @ http1 mysql] # pvcreate/dev/sda3
Physical volume "/dev/sda3" successfully created
[Root @ http1 mysql] # vgcreate myvg/dev/sda3
Volume group "myvg" successfully created
[Root @ http1 mysql] # lvcreate-L 10G-n mylv myvg
Logical volume "mylv" created
5. Support for file system xfs
[Root @ http1 mysql] # yum install xfsprogs
[Root @ http1 mysql] # mkfs-t xfs/dev/myvg/mylv
6. automatic mounting
[Root @ http1 mysql] # blkid/dev/myvg/mylv
/Dev/myvg/mylv: UUID = "b7aa948b-89d7-40d6-887b-9821a257c408" TYPE = "xfs"
[Root @ http1 mysql] # vim/etc/fstab
UUID = "b7aa948b-89d7-40d6-887b-9821a257c408"/mydata xfs defaults 0 0
[Root @ http1 mysql] # mkdir/mydata
[Root @ http1 mysql] # mount-
7. Create a directory for storing data on a logical volume and change the directory owner Group
[Root @ http1 mysql] # mkdir/mydata/data
[Root @ http1 mysql] # chown-R mysql: mysql/mydata/data
8. initialize and install mariadb
[Root @ http1 mysql] # scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data
[Root @ http1 mysql] # ls/mydata/data
Aria_log.00000001 aria_log_control mysql performance_schema test
9. Create a mariadb configuration file with a template
[Root @ http1 mysql] # mkdir/etc/mysql
[Root @ http1 mysql] # cp support-files/my-large.cnf/etc/mysql/my. cnf
Modify the configuration file:
[Root @ http1 mysql] # vim/etc/mysql/my. cnf
# The MariaDB server
[Mysqld]
Data_dir =/mydata/data # database data storage directory
Port = 3306 # listening port
Socket =/tmp/mysql. sock # socket file path
Skip-external-locking
Key_buffer_size = 256 M
Max_allowed_packet = 1 M
Table_open_cache = 256
Sort_buffer_size = 1 M
Read_buffer_size = 1 M
Read_rnd_buffer_size = 4 M
Myisam_sort_buffer_size = 64 M
Thread_cache_size = 8
Query_cache_size = 16 M
Innodb_file_per_table = on # One tablespace for each innodb File
# Try number of CPU's * 2 for thread_concurrency
Thread_concurrency = 8 # Number of threads, which is the number of cpu cores * 2
10. mariadb service Script Creation
Because mariadb is compatible with mysql, it is named mysql as a good memory.
[Root @ http1 mysql] # cp support-files/mysql. server/etc/rc. d/init. d/mysqld
[Root @ http1 mysql] # chkconfig -- list mysqld
Service mysqld supports chkconfig, but is not referenced in any runlevel (run 'chkconfig -- add mysqld ')
[Root @ http1 mysql] # chkconfig -- add mysqld
11. Start the mysqld service
[Root @ http1 mysql] # service mysqld start
Starting MySQL... [OK]
[Root @ http1 ~] # Ls/mydata/data/
Aria_log.00000001 ibdata1 mysql performance_schema
Aria_log_control ib_logfile0 mysql-bin.000001 test
Http1.stu31.com. pid ib_logfile1 mysql-bin.index
12. Test startup
Add the mysql path to the Environment Variable
[Root @ http1 mysql] # vim/etc/profile. d/mysqld. sh
Export PATH =/usr/local/mysql/bin: $ PATH
[Root @ http1 mysql] # source/etc/profile. d/mysqld. sh
[Root @ http1 mysql] # mysql
Welcome to the MariaDB monitor. Commands end with; or \ g.
Your MariaDB connection id is 2
Server version: 5.5.36-MariaDB-log MariaDB Server
Copyright (c) 2000,201 4, Oracle, Monty Program AB and others.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
MariaDB [(none)]> select version ();
+ -------------------- +
| Version () |
+ -------------------- +
| 5.5.36-MariaDB-log |
+ -------------------- +
1 row in set (0.00 sec)
Installation complete!
Install LAMP (Apache with MariaDB and PHP) in CentOS/RHEL/Scientific Linux 6)
Implementation of MariaDB Proxy read/write splitting
How to compile and install the MariaDB database in Linux
Install MariaDB database using yum in CentOS
Install MariaDB and MySQL
How to migrate MySQL 5.5 database to MariaDB 10 on Ubuntu
Install MariaDB on the Ubuntu 14.04 (Trusty) Server