title: Use MySQL with Qt on mac
body: <p>After 2 days struggling, I couldn't find any well explained way to install Mysql to use with Qt on mac. So I think this could be relevant not only for me.</p>
  
  <p><strong>Issue is at step 3.</strong></p>
  
  <p>The steps:  </p>
  
  <ol>
  <li><p>Download Qt<br>
  <a href="http://qt-project.org/downloads" rel="nofollow">http://qt-project.org/downloads</a><br>
  choose Online installer.<br>
  When installing don't forget to install Source components of your version!</p></li>
  <li><p>Download Mysql: <a href="http://dev.mysql.com/downloads/mysql/#downloads" rel="nofollow">http://dev.mysql.com/downloads/mysql/#downloads</a><br>
  DMG 32 or 64 bits<br>
  When installed open: mysql-5.5.9-osx10.6-x86_64.pkg (numbers will depend of version) and follow steps.<br>
  Open terminal (Applications, Utilities) type: </p></li>
  </ol>
  
  <blockquote>
    <p>cd /usr/local/mysql<br>
       sudo ./bin/mysqld_safe</p>
  </blockquote>
  
  <p>enter password if necessary</p>
  
  <p>Press: Ctrl + Z</p>
  
  <p>Type:</p>
  
  <blockquote>
    <p>bg</p>
  </blockquote>
  
  <p>Press: Ctrl + D<br>
  Quit Terminal.</p>
  
  <p>It's better to set a Password for after, so do it. Open again terminal an type:</p>
  
  <blockquote>
    <p>/usr/local/mysql/bin/mysqladmin -u root password YOUR_NEW_PASSWORD</p>
  </blockquote>
  
  <p>3.Install drivers in Qt  </p>
  
  <blockquote>
    <p>cd $QTDIR/src/plugins/sqldrivers/mysql<br>
    qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro<br>
    make  </p>
  </blockquote>
  
  <p><strong>STEP 3 does not work</strong> because; as Qt says:  </p>
  
  <pre><code>You need the MySQL header files and as well as the shared library libmysqlclient.so
  </code></pre>
  
  <p>How do I get those?  </p>
  
  <blockquote>
    <p>apt-get install mysql-devel  </p>
  </blockquote>
  
  <p>does not work, because I'm on mac, so installed Homebrew, but I'm not able to install with   </p>
  
  <blockquote>
    <p>brew install libmysqlclient-dev</p>
  </blockquote>
  
  <p>If someone use/used it on mac, it would be good to build proper information... </p>