1. Install the required packages for the compiled code:Yum List|grep ncurses-develyum-y Install make gcc-c++ cmake bison-devel ncurses-devel 2. Download MySQL 5.6.35wget https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.35.tar.gzTar zxvf mysql-5.6.35.tar.gzCD mysql-5.6.35 3. Directory Creation (this directory is created if the-P parent directory does not exist)mkdir-p/usr/local/mysql/data 4. Compilingcmake \-dcmake_install_prefix=/usr/local/mysql \-dmysql_datadir=/usr/local/mysql/data \-dsysconfdir=/etc \-dwith_myisam_storage_engine=1 \-dwith_innobase_storage_engine=1 \-dwith_memory_storage_engine=1 \-dwith_readline=1 \-dmysql_unix_addr=/usr/local/mysql/mysql.sock \-dmysql_tcp_port=3307 \-denabled_local_infile=1 \-dwith_partition_storage_engine=1 \-dextra_charsets=all \-ddefault_charset=utf8 \-ddefault_collation=utf8_general_ci5. InstallationMake && make install Make Clean 6. Set Permissionssee if there are MySQL users and user groupscat/etc/passwdCat/etc/groupif not, add MySQL users and GroupsGroupadd MySQLuseradd-g MySQL mysqlModify/usr/local/mysql Permissionschown-r Mysql:mysql/usr/local/mysql 7. Initialize the configurationCd/usr/local/mysqlExecute the initialization configuration script to create the system's own database and tablescripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysqlcp/usr/local/mysql/support-files my.cnf 8. Start the databaseyou need to specify MY.CNF when booting (the system will find/ETC/MY.CNF by default)/usr/local/mysql/bin/mysqld_safe--defaults-file=/usr/local/mysql/my.cnf--user=mysql & 9. Modify the database password/usr/local/mysql3307/bin/mysql-urootSET PASSWORD = PASSWORD (' Bbgolden ');GRANT All privileges on * * to ' root ' @ '% ' identified by ' Bbgolden ' with GRANT OPTION;flush Privileges;
MySQL Source package installation (for multiple MySQL)