{"id":660,"date":"2014-11-05T22:27:18","date_gmt":"2014-11-05T22:27:18","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=660"},"modified":"2019-04-01T19:15:12","modified_gmt":"2019-04-01T17:15:12","slug":"compiling-mysql-5-6-21","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/compiling-mysql-5-6-21\/","title":{"rendered":"Compiling MySql 5.6.21"},"content":{"rendered":"<pre class=\"brush:bash shell;toolbar: false\">\r\n#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here.\r\n#Before starting do declare the environment variables specified to the link above.\r\n\r\ncd $HOME\/compile\r\nrm -r $HOME\/compile\/mysql-5.6.21\r\ntar -xzvf mysql-5.6.21.tar.gz\r\ncd $HOME\/compile\/mysql-5.6.21\r\n~\/x.sh ffpg\r\n\r\nNEW_BUILD_NAME=mysql\r\nNEW_BUILD_VER=5.6.21\r\nNEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER\r\nls -l \/tmp\/$NEW_BUILD_NAME-*\r\nls -l ~\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME-*\r\nNEW_BUILD_NR=0\r\n\r\n#CMakeCache.txt:\r\nCMAKE_BUILD_TYPE:STRING=RELEASE\r\n\/\/Flags used by the compiler during all build types.\r\nCMAKE_CXX_FLAGS:STRING='-I\/ffp\/include '\r\n\/\/Flags used by the compiler during release builds.\r\nCMAKE_CXX_FLAGS_RELEASE:STRING=-O2 -DNDEBUG\r\n\/\/Flags used by the compiler during all build types.\r\nCMAKE_C_FLAGS:STRING='-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -DNDEBUG -DLINUX -I\/ffp\/include'\r\n\/\/Flags used by the compiler during release builds.\r\nCMAKE_C_FLAGS_RELEASE:STRING=-O2 -DNDEBUG\r\n\/\/Flags used by the linker.\r\nCMAKE_EXE_LINKER_FLAGS:STRING= -L\/ffp\/lib -lintl\r\n\/\/Enable\/Disable output of compile commands during generation.\r\nCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON\r\nCMAKE_INSTALL_PREFIX:PATH=\/ffp\r\n\/\/Flags used by the linker during the creation of modules.\r\nCMAKE_MODULE_LINKER_FLAGS:STRING= -L\/ffp\/lib -lintl\r\n\/\/Flags used by the linker during the creation of dll's.\r\nCMAKE_SHARED_LINKER_FLAGS:STRING= -L\/ffp\/lib -lintl\r\nCMAKE_VERBOSE_MAKEFILE:BOOL=ON\r\nENABLE_DEBUG_SYNC:BOOL=OFF\r\nFEATURE_SET:STRING=large\r\nMYSQL_DATADIR:PATH=\/ffp\/opt\/srv\/mysql\/datadir\r\nSYSCONFDIR:PATH=\/ffp\/etc\r\nTMPDIR:PATH=\/ffp\/opt\/srv\/mysql\/tmp\r\nWITHOUT_PARTITION_STORAGE_ENGINE:BOOL=ON\r\nWITH_DEBUG:BOOL=OFF\r\n#WITH_SSL=\/ffp\r\nHAVE_FINITE:INTERNAL=TRUE\r\nHAVE_FINITE_IN_MATH_H:INTERNAL=1\r\nHAVE_LLVM_LIBCPP:INTERNAL=1\r\n\u00a0\r\n#all params with help text\r\n#cmake . -LAH > cmake.help.txt\r\n#interactive display\r\nccmake . -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_FLAGS=\"$BUILD_FLAGS\" -DCMAKE_CXX_FLAGS_RELEASE=\"$BUILD_FLAGS\" -DCMAKE_C_FLAGS=\"$BUILD_FLAGS\" -DCMAKE_C_FLAGS_RELEASE=\"$BUILD_FLAGS\" -DCMAKE_EXE_LINKER_FLAGS=\"-L\/ffp\/lib -lintl\" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=\/ffp -DCMAKE_MODULE_LINKER_FLAGS=\"-L\/ffp\/lib -lintl\" -DCMAKE_SHARED_LINKER_FLAGS=\"-L\/ffp\/lib -lintl\" -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_DEBUG_SYNC=OFF -DFEATURE_SET=large -DMYSQL_DATADIR=\/ffp\/opt\/srv\/mysql\/data -DSYSCONFDIR=\/ffp\/etc -DTMPDIR=\/ffp\/opt\/srv\/mysql\/tmp -DWITH_DEBUG=0 -DHAVE_FINITE=TRUE -DHAVE_FINITE_IN_MATH_H=1\r\nccmake . -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=\/ffp -DFEATURE_SET=large\r\n#Attention, after any CMakeCache.txt modification run again configure (press c) from ccmake gui.\r\n#After running configure verify that HAVE_FINITE:INTERNAL=TRUE, HAVE_FINITE_IN_MATH_H:INTERNAL=1 and HAVE_LLVM_LIBCPP:INTERNAL=1.\r\n#Then run generate (press g).\r\n\r\nnohup \/ffp\/bin\/make -C ~\/compile\/mysql-5.6.21 &\r\n\u00a0\r\n#MAKEPKG:\r\nrm -r $HOME\/temp\/mysql-5.6.21\r\nmake install DESTDIR=$HOME\/temp\/mysql-5.6.21\r\ncd $HOME\/temp\/mysql-5.6.21\r\nfind . -type f \\( -exec sed -i s\/\"\\\/usr\\\/bin\\\/perl\"\/\"\\\/ffp\\\/bin\\\/perl\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/python\"\/\"\\\/ffp\\\/bin\\\/python\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\; , -exec sed -i s\/\"\\\/ffp\\\/ffp\\\/\"\/\"\\\/ffp\\\/\"\/ {} \\; \\)\r\nls -l \/tmp\/mysql-*\r\nls -l ~\/ffp_0.7_armv5\/packages\/mysql-*\r\nmakepkg mysql 5.6.21 0\r\n\u00a0\r\n#INSTALL & CONFIGURE\r\nfunpkg -i \/$HOME\/ffp_0.7_armv5\/packages\/mysql-5.6.21-arm-1.txz\r\n#sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES\t-> specific to mysql 5.6.x\r\nsed -i s\/\"#sql_mode\"\/\"sql_mode\"\/ \/ffp\/etc\/my.cnf\r\n\r\n#CREATE SYSTEM DB (first step and mandatory before using mysql)\r\nexport SRVPATH=\/ffp\/opt\/srv\r\nmkdir -p $SRVPATH\/mysql\/innodb\/\r\nmkdir -p $SRVPATH\/mysql\/innodblogdir\/\r\nmkdir -p $SRVPATH\/mysql\/binlog\/\r\nmkdir -p $SRVPATH\/mysql\/log\/\r\nmkdir -p $SRVPATH\/mysql\/tmp\/\r\nmkdir -p $SRVPATH\/mysql\/data\r\nchmod -R 777 $SRVPATH\r\ncd \/ffp\r\nscripts\/mysql_install_db --user=root --datadir=\/ffp\/opt\/srv\/mysql\/data\r\ncd ~ && \/ffp\/start\/mysqld.sh start\r\nmysql -p -> the default password is nothing\r\nUPDATE mysql.user SET Password = PASSWORD('xxx') WHERE User = 'root';\r\nGRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'xxx' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;\r\n#mysqladmin -u root password \"xxx\"\r\n\r\n#RESTORE BDs\r\ncp \/i-data\/md0\/seagate-ext4\/ProjectsNew\/nsa310-config\/trunk\/mysql-db-design\/*.sql.gz $HOME\/temp\/mysql-restore\r\ncd $HOME\/temp\/mysql-restore\r\ngunzip exifweb.sql.gz\r\ngunzip wordpress.sql.gz\r\ngunzip owncloud702.sql.gz\r\ngunzip ghost.sql.gz\r\ngunzip pydio.sql.gz\r\nls -l *.sql\r\n\u00a0\r\nmysql -p\r\nCREATE DATABASE exifweb CHARACTER SET utf8;\r\nCREATE DATABASE wordpress CHARACTER SET utf8;\r\nCREATE DATABASE owncloud702 CHARACTER SET utf8;\r\nCREATE DATABASE ghost CHARACTER SET utf8;\r\nCREATE DATABASE pydio CHARACTER SET utf8;\r\nGRANT ALL ON exifweb.* TO 'exifweb'@'%' IDENTIFIED BY 'exifweb' WITH GRANT OPTION;\r\nGRANT ALL ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress' WITH GRANT OPTION;\r\nGRANT ALL ON owncloud702.* TO 'owncloud702'@'%' IDENTIFIED BY 'owncloud702' WITH GRANT OPTION;\r\nGRANT ALL ON ghost.* TO 'ghost'@'%' IDENTIFIED BY 'ghost' WITH GRANT OPTION;\r\nGRANT ALL ON pydio.* TO 'pydio'@'%' IDENTIFIED BY 'pydio' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;\r\n\u00a0\r\nmysql -u root -p exifweb < exifweb.sql\r\nmysql -u root -p wordpress < wordpress.sql\r\nmysql -u root -p owncloud702 < owncloud702.sql\r\nmysql -u root -p ghost < ghost.sql\r\nmysql -u root -p pydio < pydio.sql\r\nchmod -R 777 $SRVPATH\r\n\r\n#UPGRADE DB schema\r\n#If you use InnoDB, consider setting innodb_fast_shutdown to 0 before shutting down and upgrading your server.\r\n\/ffp\/start\/mysqld.sh stop\r\nsed -i s\/\"innodb_fast_shutdown\\s*=\\s*1\"\/\"innodb_fast_shutdown = 0\"\/ \/ffp\/etc\/my.cnf\r\ngrep innodb_fast_shutdown \/ffp\/etc\/my.cnf\r\n\/ffp\/start\/mysqld.sh start\r\n\/ffp\/start\/mysqld.sh stop\r\n\/ffp\/start\/mysqld.sh start\r\nmysql_upgrade -u root -p --socket=\/ffp\/var\/run\/mysql\/mysql.sock -v\r\n\/ffp\/start\/mysqld.sh stop\r\nsed -i s\/\"innodb_fast_shutdown\\s*=\\s*0\"\/\"innodb_fast_shutdown = 1\"\/ \/ffp\/etc\/my.cnf\r\ngrep innodb_fast_shutdown \/ffp\/etc\/my.cnf\r\n\/ffp\/start\/mysqld.sh start\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here. #Before starting do declare the environment variables specified to the link above. cd $HOME\/compile rm -r $HOME\/compile\/mysql-5.6.21 tar -xzvf mysql-5.6.21.tar.gz cd $HOME\/compile\/mysql-5.6.21 ~\/x.sh ffpg NEW_BUILD_NAME=mysql NEW_BUILD_VER=5.6.21 NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/compiling-mysql-5-6-21\/#more-660\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Compiling MySql 5.6.21<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,11,163],"tags":[],"class_list":["post-660","post","type-post","status-publish","format-standard","hentry","category-compiling-from-source","category-linux","category-nsa310"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=660"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/660\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}