Environment: CentOS6.9 software version compile and install MARIADB-10.2.12.TAR.GZ1 query if MySQL is installed locally (uninstall otherwise will error); Rpm-qa | grep mysql[[email protected] ~ [] #rpm-qa | grep mysql2. Install related Development Pack Group: YUM-Y groupinstall Development Toolsyum cmake ncurses-devel gnutls-devel libaio-devel3. Query User: ( If the user already exists without common) getent passwd mysql[[email protected] ~ +] #getent passwd mysql4. Create a MySQL system User: Useradd-r mysql-s/sbin/nologin[[email protected] ~ [] #useradd-R mysql-s/sbin/nologinmysql:x : 990:305::/home/mysql:/sbin/nologin5. Unzip the source package Mariadb-10.2.12.tar.gztar XVF mariadb-10.2.12.tar.gz-c/usr/local/[[ Email protected] ~ #tar xvf mariadb-10.2.12.tar.gz-c/usr/local/6.cd into the extract directory [[email protected] ~ +] #cd/usr /local/[[email protected]/usr/local] #lsbin etc games include Lib Lib64 libexec mariadb-10.2.12 MySQL sbin share s Rc7. Perform cmake make && make install (estimated time 30 minutes) CMake. -dcmake_install_prefix=/app/mysql-dmysql_datadir=/mysqldb/-dsysconfdir=/etc-dmysql_user=mysql-dwith_innobase_ Storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_readline=1-dwith_ssl=system-dwith_zlib=system-dwith_ Libwrap=0-dmysql_unix_addr=/tmp/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dmysql_ Unix_addr=/tmp/mysql.sock-denabled_local_infile=1-dwith_partition_storage_engine=1-dwith_debug=0-dwithout_ Mroonga_storage_engine=1make && make install8. The MySQL directory under the/app directory belongs to the main MySQL group Mysqlchown-r mysql.mysql mysql/(Dangerous operation 9. Prepare the MySQL configuration file, and copy all the configuration template files in the Support-file directory with the. CNF end to the etc to modify it: Cp-a myhuge.cnf/etc/my.cnf (-a reserved permission) 10. Copy the Mysql.server file to/etc/init.d/mysqld.sh (boot fw) cp-a mysql.server/etc/init.d/mysqld.sh11. Initializing database: cd/app/mysql/ scripts/mysql_installl_db--user=mysql--datadir=/data/mtsqldb Specifies that the path to the identity of the MySQL user is specified in the configuration file (data storage location) can also be written here = See OK No error indicates success of initialization; ==12. Add boot #chkconfig--add mysqld#chkconfig mysqld on[[email protected]/app/mysql 106] #chkconfig- -list mysqldnote:this output shows SysV services only and does not include native SYSTEMD services. SysV confIguration data might is overridden by native SYSTEMD configuration. If you want to list SYSTEMD services use ' Systemctl list-unit-files '. To see services-enabled on particular target use ' systemctl list-dependencies [target] '. mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off13. Start service: #systemctl start mysqldss-tnl See if 3306 is listening 14. Compile installation complete MySQL default no password Remember to set the MySQL root user's password run security script
Compiling and installing mariadb