Lab Environment:
centos7.3 Host one set
http://mariadb.org/Download the latest source package mariadb10.2.8
Preparing the binary program
]# rz <=== Upload, from Lrzsz package]# tar xvf mariadb-10.2.8-linux-x86_64.tar.gz-c/usr/local/<===-c The specified path must be this, the source code is defined This]# cd/usr/local/]# ln-s mariadb-10.2.8-linux-x86_64/mysql
User Preparation
]# useradd-r-m-d/app/mysqldb-s/sbin/nologin mysql <=== specify user home directory for database storage path/APP/MYSQLDB
Preparing the configuration file
] #mkdir/etc/mysql] #cp/usr/local/mysql/support-files/my-large.cnf/etc/mysql/my.cnf]# vim/etc/mysql/my.cnf[mysqld ]datadir =/app/mysqldb <=== must be added innodb_file_per_table = Onskip_name_resolve = on <=== prohibit master Machine Name resolution
Create a database file
] #cd/usr/local/mysql/] #scripts/mysql_install_db--datadir=/app/mysqldb--user=mysql
Configuring Environment variables
]# vi/etc/profile.d/mysql.sh Path=/usr/local/mysql/bin: $PATH
Prepare the log file
] #mkdir/var/log/mariadb] #chown mysql/var/log/mariadb/
Prepare service script to start the service
]#&NBSP;CD&NBSP;/USR/LOCAL/MYSQL/]#&NBSP;CP&NBSP;SUPPORT-FILES/MYSQL.SERVER&NBSP;/ETC/INIT.D/MYSQLD] #service mysqld start]# ss -tanl <=== database Listener on 3306 Port state recv-q send-q Local Address:Port Peer Address:Port listen 0 128 *:22 *:* listen 0 128 :::22 :::* listen 0 80 :::3306 :::*
Safe Initialization
]# mysql_secure_installation note: running all parts of this script is recommended for all mariadb servers in production use! please read each step carefully! In order to log into mariadb to secure it, we ' ll need The currentpassword for the root user. if you ' ve just Installed mariadb, andyou haven ' t set the root password yet, the password will be blank,so you should just press enter here. enter current password for root (Enter for none): OK, Successfully used password, moving on ... setting the root password ensures that nobody can log into&Nbsp;the mariadbroot user without the proper authorisation. set root password? [y/n] new password: re-enter new password: password updated successfully! Reloading privilege tables. ... success! by default, a mariadb installation has an anonymous user, allowing anyoneto log into mariadb without having to have a user account created forthem. this is intended only for Testing, and to make the installationgo a bit smoother. you should remove them before moving into aproduction environment. remove anonymous users? [y/n] y ... success! Normally, root should only be allowed to connect from&nbSP; ' localhost '. thisensures that someone cannot guess at the root password from the network. disallow root login remotely? [y/n] y ... success! by default, mariadb comes with a database named ' Test ' that anyone canaccess. this is also intended only for testing, And should be removedbefore moving into a production environment. Remove test database and access to it? [y/n] y - dropping test database... ... success! - removing privileges on test database... ... success! Reloading the privilege tables will ensure that all changes made so farwill take effect immediately. reload p rivilege tables now? [y/n] ... success! Cleaning up ... All done! if you ' ve completed all of the above steps, Your mariadbinstallation should now be secure. thanks for using mariadb!
centos7.3 binary Installation mariadb10.2.8