I tried to install MySQL 5.7 from source file and upgrading previous MySQL version to the lastest 5.7.22.
Following command record is shared as a note.
Not many explanations. If have any questions, you can make a comment and I'll reply when I see it.
# # Referencehttps://Dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html#option_cmake_download_boost## InstallToolsYum Install Make GCC-c++ CMake Bison-devel ncurses-devel## Create user anddirIDMySQLmkdir/usr/local/MySQLmkdir-p/data/MyDBChown-R mysql.mysql/usr/local/MySQLChown-R mysql.mysql/data/mydb##UnzipSource Packagecd/home/maxwellyang/desktop/mysql-dev/Source_codeTar-ZXVF mysql-5.7. A.Tar. gz## MakeCLEANCD MySQL-5.7. A Makeclean## Run Cmakecmake-dcmake_install_prefix=/usr/local/mysql \ #Install dir-DMYSQL_DATADIR=/DATA/MYDB \ # Datadir-DSYSCONFDIR=/ETC \ # MY.CNFdir-default_charset=utf8mb4 \-ddefault_collation=Utf8mb4_general_ci-denabled_local_infile=1 -dextra_charsets= All-ddownload_boost=1\ # Auto Download Boost libraryfile-dwith_boost=/home/maxwellyang/desktop/mysql-dev/source_code/boost \ # BOOST Library Savedir-dinstall_layout=STANDALONE Make Make Install# # Problem encountered after using the compiled version/etc/init.d/mysqld Start # Execute failed without writing to MySQL error logbash-x/etc/init.d/mysqld start # To see where script stopped, suspect script maybe error out at/usr/local/mysql/bin/mysqld_s Afe--datadir=/data/mydb--pid-file=/data/mydb/mysql-Dev.pidbash-x/usr/local/mysql/bin/mysqld_safe--datadir=/data/mydb--pid-file=/data/mydb/mysql-dev.pid # Suspect script maybe error out at/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--d Atadir=/data/mydb--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql--log-error=/data/mydb/3306. err--pid-file=/data/mydb/mysql-dev.pid--port=3306/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mydb--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql--log-error=/data/mydb/3306. err--pid-file=/data/mydb/mysql-dev.pid--port=3306# this script error with [ERROR] COLLATION'Utf8mb4_general_ci'is not valid forCHARACTER SET'latin1'# Now we see problem are related to collation and characterset.# my previous database charset are latin1,whichIs the default charset if installing withTar. GZ package# But the default collation forThe compiled version is UTF8MB4_GENERAL_CI,whichIs isn't compatible with CharSet latin1# plus I Don't Specify collation-server paramter in/etc/my.cnf# So one solution are to specify Collation-server parameterinch/ETC/MY.CNF,1Usable options is collation-server=latin1_german1_ci# ThenThe above/usr/local/mysql/bin/mysqld script can success# tried the/etc/init.d/mysqld start, can work also.
Install MySQL from source and troubleshooting example