1. Install the mysql5.6 dependency Pack [[email protected] src]# yum-y install make gcc-c++ cmake bison-devel ncurses-devel libaio[[email& Nbsp;protected] src]# yum install Libaio libaio-devel-y[[email protected] src]# yum install net-tools-y2. Download the compilation package wget Https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.37-linux-glibc2.12-x86_64.tar.gztar-xvf Mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz3. Copying to the specified directory MV mysql-5.6.37-linux-glibc2.12-x86_64/usr/local/ Mysql4. Create MySQL users and Groups Groupadd mysqluseradd-r-g MySQL mysql-d/usr/local/mysqlpasswd mysql5. Modify Directory Permissions Chown-r mysql:mysql/us R/local/mysql6. Installing the database Su mysql/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql-- Datadir=/usr/local/mysql/dataexit7. Copying the MySQL configuration file cd/usr/local/mysql/support-filescp my-default.cnf/etc/ My.cnf8. Add system service CP mysql.server/etc/init.d/mysqlchkconfig MySQL on9. Add an environment variable vim/etc/profile add export mysql_home= "/ Usr/local/mysql "Export path=" $PATH: $MYSQL _home/bin "After saving exit, execute the effective code. /etc/profile10. Start Mysqlservice mysql start11. Settings root password mysqladmin-u root password ' 123456 ' 12. Set the default port vi/etc/my.cnf[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/ Mysql/dataport=3306server_id=1socket=/tmp/mysql.sockmax_allowed_packet=4m13. Allow all external links access (optional) mysql-u root- Pmysql command Line Input GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION; FLUSH privileges;14. Turn off firewall chkconfig iptables offservice iptables stop
Linux installation MySQL