The binary format is installed in the following ways:
1. Query the local installation of MySQL database related packages (uninstall) Rpm-qa "mysql*" (CENTOS6) Rpm-qa "mariadb*" (CETOS7) 2. mariadb.org Download the source binary package with the Linux word of the already compiled package: mariadb-10.2.12-linux-x86_64.tar.gz (size 440M around because it has been compiled) 3. Prepare user getent passwd MySQL query passwd whether there is a MySQL user useradd-r mysql-s/sbin/nologin create a MySQL system user [[email protected] ~] #id mysqluid=990 (MySQL) gid=305 (MySQL) groups=305 (MySQL) production environment is recommended to set a later version at least. 4. Unzip the mariadb-10.2.12-linux-x86_64.tar.gz4-1. Tar xvf mariadb-10.2.12-linux-x86_64.tar.gz-c/usr/local/Note: Unzip the directory specified, because this is a compiled source package, so the path is important to extract to the/usr/local/ Next 4-2. Renaming is required because the directory before the compilation is called MySQL; it is recommended to create a soft connection: ln-s mariadb-10.2.12-linux-x86_64/mysql5. modify file permissions default is not the main group: (Can not be modified) chown-r Mysql.mysql MYSQL/6. Export environment variable: Echo ' path=/usr/local/mysql/bin: $PATH ' >/etc/profile.d/mysql.shcat/etc/profile.d/ mysql.sh./etc/profile.d/mysql.sh (Reread profile) 7. Prepare the Data directory; Logical volume 7-1 is recommended. To create a logical Volume: Fdiak/dev/sda7-2. Synchronized disk: Partprobe (6 using PERTX) 7-3. Create the PV physical Volume: Pvcreate/dev/sda67-4. Create a volume group: vgcreate vg0-mysqldata/dev/sda6-s 16m7-5. View Volume Group: vgdisplay7-6. Creating Lvmlvcreate-n lv_mysqldata-l 100%FREE Vg0mysqlData7-7. Creating a file system for a logical Volume: Mkfs.xfs/dev/vg0mysqldata/lv_mysqldata8. Create a mount point and mount the Add/etc/fstab entry (note the current working directory. My current path is in/usr/ Local/mysql/bin) Mkdir-pv/data/mysqldbecho ' uuid=98833275-08ee-446f-b888-3e03557deedf/data/mysqldb xfs defaults 0 0 ' >>/etc/fstab (It is not recommended to add this file so that it will be awkward) mount-a reread/etc/fsatb9. This is the MySQL database directory. For security, we recommend that you modify the permissions to 770chmod 770/data/ MYSQLDB/10. Initializing database: CD scripts/scripts/mysql_install_db--datadir=/data/mysqldb--user=mysql Note: This script must be executed on its top level directory or it will error 11. Because the default configuration file is too primitive and the database path is not correct, refer to the template configuration file in the/usr/local/mysql/support-files/directory that ends with. cnf. 11-1.CP MY-HUGE.CNF/ETC/MY.CNF (overwrite the target file) is modified as follows: 12. Run the/usr/local/mysql/mysql-server service script CP Mysql.server/etc/init.d/mysqld Copy and rename Mysqldchkconfig--add mysqld Add to System script boot start 13. Service mysqld Start source installation End 14. See if there is an error message 15. View Port 3306SS- Tnl16.mysql installation Complete By default no password is required to run a security script:. /mysql_secure_installation (interactively set password and delete anonymous user) [[email protected]/usr/local/mysql/bin 178]#./mysql_secure_ Installationnote:running all PARTS of this SCRIPT are 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 would be a blank,so you should just Press ENTER here. Enter current password to root (enter for none): Enter root old password (no direct return) OK, successfully used password, moving on ... Setting The root password ensures that nobody can log into the Mariadbroot user without the proper authorisation. Set root Password? [y/n] Y set root password new password: Password re-enter new password: Confirm password Password Updated successfully! Reloading privilege tables ..... success! By default, a MariaDB installation had an anonymous user, allowing Anyoneto log into MariaDB without had to had a user Account created Forthem. This was intended only for testing, and the Installationgo a bit smoother. You should remove them before moving into aproduction environment. Remove anonymous users? [y/n] Y Delete anonymous user ...success! Normally, Root should only is allowed to connect from ' localhost '. Thisensures that someone cannot guess at the root of password from the network. Disallow Root login remotely? [y/n] n whether to disable root remote and so on ... skipping. By default, the MariaDB comes with a database named ' Test ' anyone canaccess. This was also intended only for testing, and should was removedbefore moving into a production environment. Remove test database and access to it? [y/n] Y Delete test database (randomly included test database)-dropping test ... success!-removing privileges on test database ... success! Reloading the privilege tables would ensure that all changes made so farwill take effect immediately. Reload privilege tables now? [y/n] Y is reloaded and in effect ... success! Cleaning up ... All done! If you've completed all of the above steps, your mariadbinstallation should now is secure. After the Thanks for using mariadb! security script is executed, you can start the service and test the command line to connect to MySQL.
Binary installation MySQL