標籤:you span failed log-error plugin err writing oca style
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 having any questions, you can make a comment and I will reply when I see it.
## REFERENCEhttps://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html#option_cmake_download_boost## install toolsyum install make gcc-c++ cmake bison-devel ncurses-devel## create user and dirid mysqlmkdir /usr/local/mysqlmkdir -p /data/mydbchown -R mysql.mysql /usr/local/mysqlchown -R mysql.mysql /data/mydb## unzip source packagecd /home/maxwellyang/Desktop/mysql-dev/source_codetar -zxvf mysql-5.7.22.tar.gz## make cleancd mysql-5.7.22make clean## run cmakecmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ # install dir-DMYSQL_DATADIR=/data/mydb \ # data dir-DSYSCONFDIR=/etc \ # my.cnf dir-DEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDOWNLOAD_BOOST=1 \ # auto download boost library file-DWITH_BOOST=/home/maxwellyang/Desktop/mysql-dev/source_code/boost \ # boost library save dir-DINSTALL_LAYOUT=STANDALONEmakemake 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_safe --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 --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/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 for CHARACTER SET ‘latin1‘# now we see problem is related to collation and characterset.# my previous database charset is latin1, which is the default charset when installing with tar.gz package# but the default collation for the compiled version is utf8mb4_general_ci, which is not compatible with charset latin1# plus I don‘t specify collation-server paramter in /etc/my.cnf# so one solution is to specify collation-server parameter in /etc/my.cnf, 1 usable options is collation-server=latin1_german1_ci# then the 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