install mysql from source and troubleshooting example

來源:互聯網
上載者:User

標籤: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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.