Re: [gnome-db] Provider Error on Mac OS X 10.5.8

On 7 September 2011 19:21, Patrick McEvoy <pmcevoy silvacapitalmanagement com> wrote:
On 09/07/2011 02:31 AM, Vivien Malerba wrote:

On 7 September 2011 02:40, Patrick McEvoy <pmcevoy silvacapitalmanagement com> wrote:

I have built libgda-4.2.8 on Mac OS X Leopard using gtk-osx but I am
having issues with the MySQL Provider. The machine has
mysql-5.5.15-osx10.5-x86.dmg installed.  When I try to connect the the
database I get the error "Could not open a connection to the MYSQL
Database.  No provider 'MySQL' found."

I built libgda using:

./configure --with-mysql=yes
sudo make install

For mysql ./configure has the following output:

Configuration summary for version 4.2.8
  Installation prefix = /usr/local
  Building GTK+ UI extension: yes
  Building Libxslt extension: yes
  Building libgda GObject Introspection: no
  Building libgda-ui GObject Introspection: no
  Compiled providers:
     Berkeley DB = no
     Berkeley DB SQL = no
     MDB (MS Access) = no
     MySQL = yes
     Oracle = no
     PostgreSQL = no
     SQLite = yes (embedded)
     SQLCipher = yes
     JDBC = no
     WEB = no
     LDAP = yes

Ok, this means the configure script has found the MySQL libraries.

And config.log has:

configure:20511: checking for mysql_config
configure:20529: found /usr/local/mysql/bin/mysql_config
configure:20541: result: /usr/local/mysql/bin/mysql_config

config.status:1432: creating providers/reuseable/mysql/Makefile
config.status:1432: creating providers/mysql/Makefile
config.status:1432: creating providers/mysql/libgda-mysql-4.0.pc


MYSQL_CFLAGS='-I/usr/local/mysql/include  -Os -g -fno-common
-fno-strict-aliasing -arch i386'
MYSQL_LIBS='-L/usr/local/mysql/lib -lmysqlclient   -lpthread'

The output of bash-3.2$ gda-sql -L is:

                                 Installed providers list
Provider  |

SQLite    | Provider for SQLite
SQLCipher | Provider for
Ldap      | Provider for database where tables are based on data
contained in an LDAP directory

As you guessed this means the MySQL (even though it was compiled can't be loaded).

The output of make has these errors for sql_parser:

/usr/bin/gcc-4.2 -o lemon ./lemon.c
./lemon -q -d -T./lempar.c ./delimiter.y
./lemon -d -T./lempar.c ./parser.y
3 parsing conflicts.
make[2]: [parser.h] Error 1 (ignored)

and for postgres, mysql, capi:

/usr/bin/gcc-4.2 -o gen_def
-DIMPOSED_HEADER=\""../../../libgda/sql-parser/token_types.h"\" ./gen_def.c
../../../libgda/sql-parser/lemon -q -d
-T../../../libgda/sql-parser/lempar.c ./parser.y
3 parsing conflicts.
make[3]: [parser.h] Error 1 (ignored)

These are warning about the some states in the parser generated, you can ignore them (I've never been able to figure out what they are, but the default precedence rule makes it Ok).

And a lot of warnings of:

Warning: cannot load module 'mallard', using automatic detection (-a).

This is used for the GdaBrowser's documentation. Probably Mallard is not installed.

And for make install:

Reports the above Errors.

Are the errors the cause of the provider issue?  Does anyone have any
tips on how to debug this issue?

From my own experience the problem is the /usr/local/lib/libgda-4.0/providers/libgda-mysql.dylib file can't be loaded. I would suggest the following:
- make sure that file is present (it should be as the "make install" ran Ok)
- set the GDA_SHOW_PROVIDER_LOADING_ERROR variable (export GDA_SHOW_PROVIDER_LOADING_ERROR=1) run again the "gda-sql-4.0 -L" command. See for more information.

My guess is that the /usr/local/mysql/lib (the directory containing the MySQL DLL) is not present in the search path, and adding it like the following should work:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

Also running
otool -L /usr/local/lib/libgda-4.0/providers/libgda-mysql.dylib
should give you some information on what DLL the actual MySQL provider relies.

(all the MacOSX commands and file names are from memory, so there might be some small mistakes, sorry).



I tried setting DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH and echo $DYLD_LIBRARY_PATH returned /usr/local/mysql/lib, gda-sql-4.0 -L listed MySQL but my application still "Could not open a connection to the MYSQL Database.  No provider 'MySQL' found."   I fixed it with the following command:

I don't understand how gda-sql-4.0 -L could list the MySQL provider and then say it can't find it to open a connection...

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libgda-4.0/providers/

As I understand this command changes the file to have the libMySQL DLL dependency point to a fixed path.

Is this the best solution?

I don't know. It seems to work, but it probably won't if you move the Libgda install from one place to another (for example in a MacOSX bundle).

You may also want to look in Libgda's git repo (as it's not distributes in the tarball) for some scripts I had made to create a DMG bundle for the GdaBrowser tool, see



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]