Friday, November 07, 2008

DBDesigner4 and MySQL5 on Ubuntu

This is a remake of my other article, but this focuses on efficiency rather than hand-holding. I've tested it on both Ubuntu (and also Xubuntu) Hardy Heron and Intrepid Ibex. I'm a little tired of waiting for MySQL Workbench, so I decided to give DBDesigner another shot.

What we'll use
I'll be using the RPM package since it'll make DBDesigner4 available to all users

What to Install
Install alien via aptitude (or apt-get, whichever you prefer)
sudo aptitude install alien

What to Download
DBDesigner4-0.5.4-0.i586.rpm
http://fabforce.net/downloadfile.php?iddownloadfile=9

kylixlibs3-borqt-3.0-2.tar.gz
http://prdownloads.sourceforge.net/kylixlibs/kylixlibs3-borqt-3.0-2.tar.gz?download

dbxmda.tar.gz
http://crlab.com/dbx/download.html

MySQL-shared-compat-4.1.9-0.i386.rpm
ftp://ftp.wesmo.com/pub/contributed/RPMS/MySQL-shared-compat-4.1.9-0.i386.rpm

How to Install
For convenience sake, save or move the four files to a temporary directory (e.g. ~/temp) then issue to following commands:

For DBDesigner4
  • sudo alien -i DBDesigner4-0.5.4-0.i586.rpm
For kylixlibs3-borqt-3.0-2.tar.gz
  • tar xzvf kylixlibs3-borqt-3.0-2.tar.gz
  • sudo cp kylixlibs3-borqt/libborqt-6.9.0-qt2.3.so /usr/lib/libborqt-6.9-qt2.3.so

For dbxmda.tar.gz
  • tar zxvf dbxmda.tar.gz
  • sudo cp DbxMda/libsqlmda.so.4.20 /usr/lib

For MySQL-shared-compat-4.1.9-0.i386.rpm
  • sudo alien -i MySQL-shared-compat-4.1.9-0.i386.rpm
*Note: no need to run sudo ldconfig after copying the libs since the last command will run it anyway.

What we Installed
DBDesigner4-0.5.4-0.i586.rpm: the DBDesigner4 application

kylixlibs3-borqt-3.0-2.tar.gz: the libborqt object file, this will prevent "libborqt-6.9-qt2.3.so: cannot open shared object file: No such file or directory" errors

dbdesigner03.png

dbxmda.tar.gz: the libsqlmy object file, this will prevent "Unable to Load libsqlmy.so" errors



MySQL-shared-compat-4.1.9-0.i386.rpm: some may encounter the "unable to load libmysqlclient.so" error. There's an incompatibility issue with libmysqlclient.so.15, so you'll need to download and install libmysqlclient.so.10.

What we need to Configure
Fonts
Access the fonts settings from Options > DBDesigner Options > Visual Options and set it to Helvetica sized 10

Menu
Here's the menu settings
Name: DBDesigner4
Icon: /opt/DBDesigner4/Gfx/Icon48.xpm
Command: /opt/DBDesigner4/DBDesigner4

Configuration File
Open ~/.DBDesigner4/DBConn_DefaultSettings.ini in a text editor and change the folowing:

GetDriverFunc=getSQLDriverMYSQL
LibraryNameLinux=libsqlmy.so
VendorLibLinux=libmysqlclient.so

to

GetDriverFunc=getSQLDriverMySQL
LibraryNameLinux=libsqlmda.so.4.20
VendorLibLinux=libmysqlclient.so.10

MySQL5 Settings
In order for DBDesigner4 to access your MySQL5 tables, you need to create another user and set its password to an old format DBDesigner4 understands. Login as root (or as a user that can grant privileges) then execute the commands listed below. Change the username, password, and dbname where appropriate:
  • GRANT ALL PRIVILEGES ON dbname.* TO username@'%'
  • SET PASSWORD FOR username@'%' = OLD_PASSWORD('password')
  • FLUSH PRIVILEGES
How to Reverse Engineer your Database
I believe this article is best suited for this section since it includes screenshots as well as walkthroughs.

Sources:
http://ubuntuforums.org/showthread.php?t=125911
http://www.visualcplusdotnet.com/dbdesignerdatabasetool.html