What is the Universal binary format?
A compiled software package that is downloaded to the native format that can be used to extract it directly to a specific directory. 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. Create LvmlvcreaTe-n lv_mysqldata-l 100%free vg0mysqldata7-7. Creating a file system for a logical Volume: Mkfs.xfs/dev/vg0mysqldata/lv_mysqldata8. Create mount point and mount add/etc/ Fstab entry (Note the current working directory. My current path is at/usr/local/mysql/bin) Mkdir-pv/data/mysqldbecho ' uuid= 98833275-08ee-446f-b888-3e03557deedf/data/mysqldb XFS defaults 0 0 ' >>/etc/fstab (recommended not to add this file is embarrassing) Mount-a reread /etc/fsatb9. This is the MySQL database directory. For security reasons, 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/usr/local/mysql/ Template configuration file with. cnf ending in the support-files/directory. 11-1.CP my-huge.cnf/etc/my.cnf (overwrite the target file) is modified as follows: 12. Run/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 boot 13. Start Service: Services 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 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 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 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. Thanks for using mariadb! start service: Service mysqld start Local install MySQL mysql-client command line test connection
Install MySQL in binary format