{"id":373,"date":"2011-04-07T11:34:08","date_gmt":"2011-04-07T11:34:08","guid":{"rendered":"http:\/\/10sa.com\/sql_stories\/?p=373"},"modified":"2014-08-21T09:13:08","modified_gmt":"2014-08-21T09:13:08","slug":"mysql-source-instalation-5-5","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=373","title":{"rendered":"MySQL source installation 5.5"},"content":{"rendered":"<p>I usually install all my database servers from source. This gives me control over server available options and allows me to disable any unwanted options. I am not dependent on OS, too.<br \/>\nTypically I used following combination:<\/p>\n<pre lang=\"bash\">CFLAGS=\"-O3\" CXX=gcc CXXFLAGS=\"-O3 -felide-constructors \\\r\n-fno-exceptions -fno-rtti\" .\/configure \\\r\n--prefix=\/usr\/local\/services\/mysql \\\r\n--with-mysqld-ldflags=-all-static \\\r\n--enable-assembler \\\r\n--with-big-tables \\\r\n--with-tcp-port=3306 \\\r\n--with-unix-socket-path=\/tmp\/mysql.sock \\\r\n--without-debug \\\r\n--without-docs \\\r\n--without-geometry \\\r\n--without-man \\\r\n--with-charset=latin2 \\\r\n--with-extra-charsets=utf8 \\\r\n--with-collation=latin2_general_ci \\\r\n--with-plugins=partition,blackhole,innodb \\<\/pre>\n<p>From MySQL 5.5 configure was replaced with cmake&#8230; and installation and gains are not so obvious.<br \/>\nI use CentOS release 5.5 (Final). Before you start to compile, you have to install:<\/p>\n<p>CentOS release 5.5 (Final)<\/p>\n<pre lang=\"bash\">yum install gcc-c++\r\nyum install ncurses-devel\r\nyum install bison.x86_64\r\nyum install cmake (CentOS release 6.3)\r\n# or install from source cmake.org<\/pre>\n<p>You have to compile cmake (<a href=\"http:\/\/cmake.org\">cmake.org<\/a>)<\/p>\n<p>Debian 6.0 (Squeeze)<\/p>\n<pre lang=\"bash\">aptitude install g++\r\naptitude install make\r\naptitude install ncurses-dev\r\naptitude install bison++\r\naptitude install cmake<\/pre>\n<p>There is a very helpful site on mysql: <a href=\"http:\/\/forge.mysql.com\/wiki\/Autotools_to_CMake_Transition_Guide\">Autotools_to_CMake_Transition_Guide<\/a><\/p>\n<p>My new recipe is:<\/p>\n<pre lang=\"bash\">cmake . \\\r\n-DCMAKE_C_FLAGS=\"-O3 -m64\" \\\r\n-DCMAKE_CXX_FLAGS=\"-m64 -O3 -felide-constructors -fno-exceptions -fno-rtti\" \\\r\n-DCMAKE_BUILD_TYPE=RelWithDebInfo \\\r\n-DCMAKE_INSTALL_PREFIX=\/usr\/local\/services\/mysql \\\r\n-DSYSCONFDIR=\/usr\/local\/services\/mysql \\\r\n-DWITH_INNOBASE_STORAGE_ENGINE=1 \\\r\n-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \\\r\n-DWITH_PARTITION_STORAGE_ENGINE=1 \\\r\n-DWITH_FEDERATED_STORAGE_ENGINE=1 \\\r\n-DDEFAULT_CHARSET=latin2 \\\r\n-DWITH_EXTRA_CHARSETS=utf8 \\\r\n-DDEFAULT_COLLATION=latin2_general_ci \\\r\n-DWITH_DEBUG=0 \\\r\n-DENABLE_DEBUG_SYNC=0 \\\r\n-DWITH_FAST_MUTEXES=0 \\<\/pre>\n<p>I did not find any replacement for the following:<br \/>\n&#8211;with-mysqld-ldflags=-all-static<br \/>\n&#8211;enable-assembler<br \/>\n&#8211;with-big-tables<br \/>\n&#8211;without-docs<br \/>\n&#8211;without-geometry<br \/>\n&#8211;without-man<\/p>\n<p>I was curious about option -DWITH_FAST_MUTEXES, however, I did not find any sources which would encourage me to turn it on:<\/p>\n<ul>\n<li><a href=\"http:\/\/code.google.com\/p\/google-mysql-tools\/wiki\/Mysql5Patches\">http:\/\/code.google.com\/p\/google-mysql-tools\/wiki\/Mysql5Patches<\/a><\/li>\n<li><a href=\"http:\/\/bugs.mysql.com\/bug.php?id=51285\">http:\/\/bugs.mysql.com\/bug.php?id=51285<\/a><\/li>\n<\/ul>\n<h3>Postinstallation issues:<\/h3>\n<h5>Open files limit<\/h5>\n<p>Important when partitioning is widely used.<br \/>\nIn mysql configuration file (my.cnf) in section [mysqld]<br \/>\nopen_files_limit=65536<br \/>\nIn system file \/etc\/security\/limits.conf<\/p>\n<pre>\r\nmysql           soft    nofile  32768                                                                                                                                  \r\nmysql           hard    nofile  65536  \r\nmysql           soft           nproc           2047\r\nmysql           hard           nproc           16384\r\n<\/pre>\n<h5>Swapiness<\/h5>\n<p>cat \/proc\/sys\/vm\/swappiness<br \/>\necho 1 > \/proc\/sys\/vm\/swappiness<br \/>\necho &#8220;vm.swappiness = 1&#8221; >> \/etc\/sysctl.conf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I usually install all my database servers from source. This gives me control over server available options and allows me to disable any unwanted options. I am not dependent on OS, too. Typically I used following combination: CFLAGS=&#8221;-O3&#8243; CXX=gcc CXXFLAGS=&#8221;-O3 -felide-constructors \\ -fno-exceptions -fno-rtti&#8221; .\/configure \\ &#8211;prefix=\/usr\/local\/services\/mysql \\ &#8211;with-mysqld-ldflags=-all-static \\ &#8211;enable-assembler \\ &#8211;with-big-tables \\ &#8211;with-tcp-port=3306 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,3],"tags":[],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/373"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=373"}],"version-history":[{"count":30,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":874,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/373\/revisions\/874"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}