CentOS 7 General binary Format installation method summary

Source: Internet
Author: User


Mariadb Installation method:

(1) RPM package;

(a) provided by the vendor of the OS

(b) The procedure is officially provided

(2) source code package;

(3) Generic binary format package;


Lab Environment:

Installation System: CentOS 7

Installer: Mariadb

Installation method: Universal Binary



(1) Download the package and unzip


# CP /usr/lib/systemd/system/mariadb.service /root//previously installed, now backed up under


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/04/wKioL1dHzavCwax5AAAx9BujXmQ921.jpg "title=" Uninstall Pre-installation Mariadb.jpg "alt=" wkiol1dhzavcwax5aaax9bujxmq921.jpg "/>//have dependencies


# yum Remove Mariadb-server


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/05/wKiom1dHzaGgUZZ8AAAV0j8hWEo953.jpg "title=" Uninstall the pre-installation mariadb-2.jpg "alt=" Wkiom1dhzagguzz8aaav0j8hweo953.jpg "/>



Download the binary-installed package, downloaded here for mariadb-5.5.46-linux-x86_64.tar.gz


# ls

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/82/05/wKiom1dHzebQJGTHAAAl3YETxiU777.jpg "title=" Download package. jpg "alt=" wkiom1dhzebqjgthaaal3yetxiu777.jpg "/>



# Tar xf mariadb-5.5.46-linux-x86_64.tar.gz-c/usr/local/


# cd/usr/local

    #  LN-SV Mariadb-5.5.46-linux-x86_64/mysql//Here is not recommended to create MySQL files, should be linked to the way

             

# groupadd-r-G 306 MySQL//Create a system user for security reasons

# Cd/usr/local/mysql


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/04/wKioL1dHzySi0RAAAACgioL4fpw419.jpg "title=" mysql file. jpg "alt=" wkiol1dhzysi0raaaacgiol4fpw419.jpg "/>


# chown-r Root:mysql./*


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/82/04/wKioL1dHz2byivr_AAC_oENDeTs845.jpg "title=" The MySQL file belongs to the main genus group. jpg "alt=" wkiol1dhz2byivr_aac_oendets845.jpg "/>



(2) Create a database storage directory

# MKDIR/MYDATA/DATA-PV

# Chown-r Mysql.mysql/mydata/data



(3) Provision of configuration files for MySQL

MySQL default read file for/ETC/MY.CNF//Before installing MARIADB, Mariadb-libs provides the


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/82/04/wKioL1dHz9GylEC3AAC4r9dofs0503.jpg "title=" Previous configuration file. jpg "alt=" wkiol1dhz9gylec3aac4r9dofs0503.jpg "/>


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/82/05/wKiom1dHzvWzQcbBAABHyG3HrjE800.png "title=" Unzip the configuration file. png "alt=" Wkiom1dhzvwzqcbbaabhyg3hrje800.png "/>


[[email protected] mysql]# mkdir/etc/mysql//Create profile directory

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

[email protected] mysql]# vim/etc/mysql/my.cnf


DataDir =/mydata/data

Skip_name_resolve = On

Innodb_file_per_table = On


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/05/wKiom1dHz4CQrjJ4AABf5AkaYuE209.jpg "title=" Modify the configuration file. jpg "alt=" wkiom1dhz4cqrjj4aabf5akayue209.jpg "/>

You must add these three lines under [Mysqld]

[[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld //copy start MySQL file, and make sure that it has execute permissions


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/82/04/wKioL1dH0LqgReaaAAApbbZxFeM935.jpg "title=" startup file. jpg "alt=" wkiol1dh0lqgreaaaaapbbzxfem935.jpg "/>



[email protected] mysql]# chkconfig --Add mysqld//Note Yes--


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/04/wKioL1dH0QPiKiuOAABSuNLfPH4304.jpg "title=" Start the 1.jpg "alt=" Wkiol1dh0qpikiuoaabsunlfph4304.jpg "/>



(4) Initializing MySQL database


Initialization reason: The above start will be problematic, the data will be placed in/var/lib/mysql/, not/mydata/data. Because the profile/etc/mysql/my.cnf we created will conflict with the/ETC/MY.CNF before the system, we need to store the/etc/my.cnf somewhere else.


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/82/05/wKiom1dH0FHTe9JQAABgAos998I397.png "title=" Before initializing. png "alt=" Wkiom1dh0fhte9jqaabgaos998i397.png "/>


Initialization process:

[[email protected] mysql]# rm/mydata/data/*-F //Delete error log information generated before, etc.


[email protected] mysql]# scripts/mysql_install_db- -User=mysql -- Datadir=/mydata/data//initialization must be performed in the/usr/local/mysql directory


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/05/wKiom1dH0MiSTho9AAAbgmLMzm8924.jpg "title=" Initialization complete. jpg "alt=" wkiom1dh0mistho9aaabgmlmzm8924.jpg "/> //Database data generation

At this point, when you start MySQL, you will find that the database started successfully.


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/04/wKioL1dH0gLiceCrAAB2bmnAwzw179.jpg "title=" Start successfully. jpg "alt=" wkiol1dh0glicecraab2bmnawzw179.jpg "/>


additional : Check the current MySQL Help information and find out the MySQL profile read path and the previous understanding of the discrepancy, you need to be aware of it.


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/82/05/wKiom1dH0TPQvbVwAACocNyiLL4418.jpg "title=" Configuration file read order. jpg "alt=" wkiom1dh0tpqvbvwaacocnyill4418.jpg "/>



at this point, the generic binary installation MARIADB process is complete. The problem that occurs during personal installation causes MySQL to start failure summary:

     1, modify the configuration file, skip_ Name_resolve = on     Write resolve in reslove  

2, [[email protected] mysql]# scripts/mysql_install_db --user=mysql - - Datadir=/mydata/data only wrote one. - .

The problem is very low, but finally check the wrong, feel very deep, will not happen again this mistake, write any file should be carefully reviewed and checked.



CentOS 7 General binary Format installation method summary

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.