Install the mysql source code package (applicable to multiple mysql) and mysql source code
1. install the required package for compiling the 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 (-p parent directory does not exist, create this directory) mkdir-p/usr/local/mysql/data 4. compile cmake \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DMYSQL_DATADIR =/usr/local/mysql/data \-DSYSCONFDIR =/etc \-runtime = 1 \-DWITH_INNOBASE_STORAGE_ENGINE = 1 \-DWITH_MEMORY_STORAGE_ENGINE = 1 \-DWITH_READLINE = 1 \-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \-DMYSQL_TCP_PORT = 3307 \-DENABLED_LOCAL_INFILE = 1 \-character = 1 \-DEXTRA_CHARSETS = all \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_general_ci5. install make & make installmake clean 6. set permissions to check whether mysql users and user groups are available cat/etc/passwdcat/etc/group. If not, add mysql users and group groupadd mysqluseradd-g mysql Modify/usr/local/mysql permissions. chown-R mysql: mysql/usr/local/mysql 7. initialize the configuration cd/usr/local/mysql and execute the initialization configuration script, create the built-in database and table scripts/mysql_install_db -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data -- user = mysqlcp/usr/local/mysql /support-files my. cnf 8. when starting the database, you must specify my. cnf (the system will first find/etc/my. cnf)/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;