CentOS 7.3 Binary installation mariadb10.2.8 Perfect step

Source: Internet
Author: User
Tags prepare

(1) on the CENTOS7 system, yum info mariadb can find the official website providing the MARIADB package, download the latest MARIADB package to the official website, and then RZ to the Linux system (2) Prepare the user
// - R Create System user,-D specify home directory,-M force to create home directory,-s specifies that the shell does not allow this user to log on
(3) Preparing the database directory to create a MySQL user-specified home directory is the database directory, but logical volumes are recommended, because the directory is stored in a database, and the logical volume can be expanded. (4) Prepare the binary program
1. tar xvf mariadb-10.2. 8-linux-x86_64. tar. gz-c/usr/local  // default is placed in/usr/local directory 2. CD  /usr/local 3. Ln -S mariadb-10.2. 8-linux-x86_64. tar. GZ/MYSQ  // under/usr/local, the directory of the MARIADB database has been generated, but this directory does not meet the requirements, Requirements MARIADB database must be placed in the MySQL directory, so there are two ways to solve, one is renamed, the resulting MARIADB database directory is changed to MySQL, the second is to create a soft link, we choose to create a soft link way

(5) Preparing the configuration file
1. cd/usr/local/mysql/support-files//Some files in this directory can be used as MySQL config file, we choose MY-HUGE.CNF as the MySQL configuration file2.mkdir/etc/mysql///Create a directory of MySQL configuration files3.CPMy-huge.cnf/etc/mysql/my.cnf//MySQL configuration file name is also required, so rename to My.cnf4. vim/etc/mysql/my.cnf//After copying it, we need to modify the configuration file.[Mysqld]datadir=/app/mysqldb//where the database data is placed, the key line must be added, the following two lines can not be addedInnodb_file_per_table = On//There are many tables in the database, plus this line allows each table to generate a separate fileSkip_name_resolve = On//to speed up access, ignore reverse parsing of namesSo the configuration file is ready for editing.

(6) Create a database file
1. cd/usr/local/mysql/2. scripts/mysql_install_db  // Create a MySQL database, Specifies the path to the database and the identity of the user name, and the database file is generated under/app/mysqldb after execution. Note: Create a MySQL system database, the system provides a script, we can directly use it to generate MySQL system database, this script is under scripts, but do not go in to run the script, otherwise it will be error, must be in/usr/local/mysql/ run the script under 3. ls // review the resulting database file

(7) Preparing the log file
1. mkdir/var/log/mariadb/  // directory where log files are created 2. Chown mysql/var/log/mariadb/  // because the log is written as a MySQL user, creating this directory must also modify its own MySQL to ensure that MySQL users have write access to the/var/log/mariadb/directory
(8) Start-up service
1. CP  support-files/mysql.server  /etc/init.d/mysqld  // in/usr/local/mysql/ Support-files Directory has a ready-made service script, but this service script must be placed under the specified directory/etc/init.d/to use, copied to this directory, and renamed MYSQLD, the service name in the future is called Mysqld2 . Chkconfig--3// start service, after successfully opening the service, 3306 Port 4 will be opened . Ss-nutl  // Check to see if Port 3306 is open
(9) Add path variable for easy running of MySQL program
1. Vim  /etc/profile.d/mysql.shPATH=/usr/local/mysql/bin: $PATH2../etc/ profile.d/mysql.sh  // make the added path variable take effect
(10) Running MySQL security script
1. cd/usr/local/2. mysql_secure_installation
(11) test, run the MySQL program,-u Specify the user,-p followed by the password (the password is the last step to run the security script to the root user set the password)
Mysql-uroot-p Password

To this in the CentOS 7.3 binary installation mariadb10.2.8 has ended, in CENTOS6 installation installation MARIADB 5.5.57 and installed in the CENTOS7 is basically the same as the log directory is written, the log directory written in CENTOS6 is /var/log/, you just need to create this directory and modify it to belong to the human MySQL on it. Well, today's content to this end, I hope to have some help, there are shortcomings also please more guidance.

CentOS 7.3 Binary installation mariadb10.2.8 Perfect step

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.