{"id":742,"date":"2023-09-18T08:10:08","date_gmt":"2023-09-18T13:10:08","guid":{"rendered":"https:\/\/www.jmjatlanta.com\/?p=742"},"modified":"2023-09-18T11:13:11","modified_gmt":"2023-09-18T16:13:11","slug":"compiling-mysql-on-amazon-ec2","status":"publish","type":"post","link":"https:\/\/www.jmjatlanta.com\/index.php\/2023\/09\/18\/compiling-mysql-on-amazon-ec2\/","title":{"rendered":"Compiling MySQL on Amazon EC2"},"content":{"rendered":"\n<p>I have an application that needs the MySQL C++ Connector. Unfortunately, I have been unable to find a binary version of MySQL or MySQL Connector that works on an Amazon EC2 instance. Here are my notes about how I am compiling MySQL and MySQL Connector C++ on Amazon EC2<\/p>\n\n\n\n<p>Firstly, a bit about why this is a problem. Amazon EC2 uses glibc 2.26. The binary distributions use glibc 2.12, 2.17, or 2.28. Unfortunately, I have been unable to get any of them to work. So, I must build things myself. If someone has a better idea, I am all ears. I scoured the Internet attempting an easier solution with no joy.<\/p>\n\n\n\n<p>Fortunately, the source distribution uses cmake, so it is fairly easy to compile the components myself, albeit with a good chunk of extra disk space required.<\/p>\n\n\n\n<p>Firstly, download the source distribution of MySQL. 8.0.25. I tried newer versions, but they require C++17, which Amazon EC2&#8217;s default packages use a GCC version that is too old, so I backed up a few versions. A basic gcc\/g++ environment is necessary. Things like cmake, build-essentials, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install ncurses-devel\ntar xzvf mysql_source.tar.gz # or whatever the tar is named\ncd mysql-long-named-directory\nmkdir build\ncd build\ncmake -DCMAKE_INSTALL_PREFIX=\/home\/me\/mysql8025 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=\/home\/me\/boost173 ..<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have an application that needs the MySQL C++ Connector. Unfortunately, I have been unable to find a binary version of MySQL or MySQL Connector that works on an Amazon EC2 instance. Here are my notes about how I am compiling MySQL and MySQL Connector C++ on Amazon EC2 Firstly, a bit about why this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-742","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/comments?post=742"}],"version-history":[{"count":4,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/742\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/posts\/742\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/media?parent=742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/categories?post=742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jmjatlanta.com\/index.php\/wp-json\/wp\/v2\/tags?post=742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}