segunda-feira, 14 de outubro de 2013

Solving MySQL Error "The server quit without updating PID file (/usr/local/var/mysql/XXXX.pid)"

Today I ran out through this problem when trying to start mysql service. It took an hour to solve, and the problem wasn't really with MySQL.
If you look at the log it creates inside the mysql data folder you'll see several of permission denied warning, and that's really it.

Simply change the permission of every folder inside mysql recursively to, say, 777.
* So, run terminal.app;
* Go the mysql folder;
* Type "sudo chmod -R 777 ./*" (don't you dare to type the quotes);

Done. Try to start the server again, and it should work like a charm.

I'm using OSX 10.9, but I think it works for every linux/unix systems.
See u.

quinta-feira, 10 de outubro de 2013

Build MySQL Driver for Qt 5 on Mac OSX Mavericks

That bugged me for awhile. But when I tried to compile the MySQL driver for Qt it compile fine. But somehow when putting the file inside the QTDIR/.../plugins/sqldrivers it wouldn't work! I just kept getting driver not loaded. And when calling QSqlDatabase::drivers() MySQL just wans't there.
Finally I found the solution:
  • open the terminal
  • navigate to sqldrivers on QTDIR folder
  • and run the command:
install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient_r.18.dylib libqsqlmysql.dylib

Now it works just fine!