{"id":927,"date":"2008-08-08T04:31:40","date_gmt":"2008-08-08T09:31:40","guid":{"rendered":"http:\/\/www.bytebot.net\/blog\/?p=927"},"modified":"2008-08-08T04:31:40","modified_gmt":"2008-08-08T09:31:40","slug":"howto-mysql-connectorc-on-mac-os-x","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x","title":{"rendered":"HOWTO: MySQL Connector\/C++ on Mac OS X"},"content":{"rendered":"<p>Excited with the <a href=\"http:\/\/blog.ulf-wendel.de\/?p=185\">release<\/a> of the <a href=\"http:\/\/forge.mysql.com\/wiki\/Connector_C%2B%2B\">MySQL Connector\/C++<\/a>, I thought I&#8217;d get it going on Mac OS X.<\/p>\n<p>You&#8217;ll first hit the problem that Mac OS X doesn&#8217;t come with <a href=\"http:\/\/www.cmake.org\/HTML\/index.html\">CMake<\/a>. So you&#8217;ll have to download it from the site &#8211; there&#8217;s a warning there that the .dmg installer only works for Tiger, but I ran it on Leopard, and its just fine. Don&#8217;t forget to allow it to create links in \/usr\/bin for ease of use.<\/p>\n<p>After that, you will need to install <a href=\"http:\/\/www.gtk.org\/\">glib<\/a>. But to get glib going, you need some dependencies:<\/p>\n<ul>\n<li><a href=\"ftp:\/\/ftp.gnu.org\/pub\/gnu\/gettext\/\">gettext<\/a><\/li>\n<li><a href=\"http:\/\/pkgconfig.freedesktop.org\/wiki\/\">pkgconfig<\/a><\/li>\n<li>and then <a href=\"ftp:\/\/ftp.gtk.org\/pub\/glib\/\">glib<\/a><\/li>\n<\/ul>\n<p>Installing them is simple: untar (<tt>tar -zxvpf package.tar.gz<\/tt>), <tt>.\/configure<\/tt>, <tt>make<\/tt>, then a <tt>sudo make install<\/tt>.<\/p>\n<p>Now, the README file or the instructions on the wiki will just work. I have several MySQL installations, so I preferred to specify what cmake found. I did this by:<br \/>\n<code>cmake -D MYSQL_DIR:PATH=\/usr\/local\/mysql\/ -D GLIB_DIR:PATH=\/usr\/local\/lib\/glib-2.0\/ .<\/code><\/p>\n<p>Then a simple make, and you can go on and try the examples, in <tt>examples\/<\/tt>. Try the <tt>connect<\/tt> application to make sure things are working. You will probably run into a snag though:<\/p>\n<blockquote><p><code><br \/>\nluna:examples ccharles$ .\/connect<br \/>\nConnector\/C++ connect basic usage example..<\/code><\/p>\n<p><code>ERR: MySQL_DbcException in \/Users\/ccharles\/code\/mysql_connector_cpp_1_0_0_preview\/examples\/connect.cpp((function n\/a)) on line 159<br \/>\nERR: Cannot connect (MySQL error code: 0 )<\/code><\/p><\/blockquote>\n<p>Take a look at <tt>examples\/examples.h<\/tt>, and look at the connection properties. It uses the test database, on localhost (127.0.0.1), standard port 3306, user is root, and the <strong>default password set there is root<\/strong> too. This may not be the commonest setting, so don&#8217;t hesitate to change the password or leave it blank (ala a default install), and rerun make. The sample applications will now work :)<\/p>\n<p>Congratulations to Andrey, Ulf, and the rest of the connectors team in getting this going!<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20HOWTO%3A%20MySQL%20Connector%2FC%2B%2B%20on%20Mac%20OS%20X&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2008%2F08%2F08%2Fhowto-mysql-connectorc-on-mac-os-x&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"e59ebc0607\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-927\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-927\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-927\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Excited with the release of the MySQL Connector\/C++, I thought I&#8217;d get it going on Mac OS X. You&#8217;ll first hit the problem that Mac OS X doesn&#8217;t come with CMake. So you&#8217;ll have to download it from the site &#8211; there&#8217;s a warning there that the .dmg installer only works for Tiger, but I [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20HOWTO%3A%20MySQL%20Connector%2FC%2B%2B%20on%20Mac%20OS%20X&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2008%2F08%2F08%2Fhowto-mysql-connectorc-on-mac-os-x&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"e59ebc0607\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-927\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-927\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-927\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/08\/08\/howto-mysql-connectorc-on-mac-os-x?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[23],"tags":[46,389,390,1775],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-eX","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":529,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/24\/myodbc-not-showing-in-drivers-list-on-mac-os-x","url_meta":{"origin":927,"position":0},"title":"MyODBC not showing in drivers list on Mac OS X","date":"24\/4\/2007","format":false,"excerpt":"Today I missed a bunch of good talks that I was hoping to attend, because I was figuring out a problem at the Guru Bar. Offending criminal: MySQL Connector\/ODBC 3.51. Offending OS: Mac OS X\/PowerPC. OS X comes with an ODBC Administrator. Once you unpack the MySQL package, and the\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3296,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2016\/12\/01\/debian-and-mariadb-server","url_meta":{"origin":927,"position":1},"title":"Debian and MariaDB Server","date":"1\/12\/2016","format":false,"excerpt":"GNU\/Linux distributions matter, and Debian is one of the most popular ones out there in terms of user base. Its an interesting time as MariaDB Server becomes more divergent compared to upstream MySQL, and people go about choosing default providers of the database. The MariaDB Server original goals were to\u2026","rel":"","context":"In &quot;Distributions&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":780,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/04\/14\/compiling-mysql-udfs-on-mac-os-x","url_meta":{"origin":927,"position":2},"title":"Compiling MySQL UDFs on Mac OS X","date":"14\/4\/2008","format":false,"excerpt":"Compiling and installing a User Defined Function for MySQL on Mac OS X seems tricky. There are installation notes, but they seem to be sparse on OS X (the comments are clues, though). I was looking through the tutorial materials for Roland's talk, and came up with what I think\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2743,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2013\/06\/11\/homebrew-mac-os-x-and-mariadb-10-0-series","url_meta":{"origin":927,"position":3},"title":"Homebrew (Mac OS X) and MariaDB 10.0 series","date":"11\/6\/2013","format":false,"excerpt":"Today I performed a brew update. I noticed that MariaDB now exists as stable (5.5.30) and devel (10.0.2). Brew formulas also exist for MySQL (5.6.10) and Percona Server (5.5.30-30.2) now. 10.0.3 is around the corner but I wanted to run 10.0.2 now. This is how I did it: brew unlink\u2026","rel":"","context":"In &quot;MariaDB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":781,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/04\/14\/my-favourite-bugfix-in-mysql-5124-rc","url_meta":{"origin":927,"position":4},"title":"My favourite bugfix in MySQL 5.1.24-rc","date":"14\/4\/2008","format":false,"excerpt":"I've been using MySQL 5.1 a lot more of late. Also, as of about a month ago, I'm now a Mac OS X user, so tend to use MySQL on OS X Leopard 10.5 a lot more for testing. I've found a rather annoying bug (in 5.1.23-rc) that is fixed\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":425,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2006\/08\/22\/mysql-connectorphp-for-mysql-5024-and-php-515-released","url_meta":{"origin":927,"position":5},"title":"MySQL Connector\/PHP for MySQL 5.0.24 and PHP 5.1.5 released","date":"22\/8\/2006","format":false,"excerpt":"We interrupt this scheduled viewing, for our faithful Windows users... We have a new release of the MySQL Connector\/PHP. MySQL has released 5.0.24 for a bit, and PHP themselves have released 5.1.5. The PHP release actually fixes some security related issues. Be sure to check the forums out if you\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/927"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=927"}],"version-history":[{"count":1,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/927\/revisions"}],"predecessor-version":[{"id":928,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/927\/revisions\/928"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=927"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}