On 09/07/2011 02:31 AM, Vivien Malerba wrote:
>
>
> On 7 September 2011 02:40, Patrick McEvoy
> <[email protected]
> <mailto:[email protected]>> wrote:
>
>     Hello,
>
>     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
>     make
>     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
>
>     ac_cv_path_MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
>
>     MYSQL_CFLAGS='-I/usr/local/mysql/include  -Os -g -fno-common
>     -fno-strict-aliasing -arch i386'
>     MYSQL_CONFIG='/usr/local/mysql/bin/mysql_config'
>     MYSQL_FALSE='#'
>     MYSQL_LIBS='-L/usr/local/mysql/lib -lmysqlclient   -lpthread'
>     MYSQL_TRUE=''
>
>     The output of bash-3.2$ gda-sql -L is:
>
>                                      Installed providers list
>     Provider  |
>     Description
>
>     
> ----------+------------------------------------------------------------------------------------
>     SQLite    | Provider for SQLite
>     databases
>     SQLCipher | Provider for
>     SQLCipher
>     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
> http://developer-next.gnome.org/libgda/stable/init_config.html#libgda_env_variables
> 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).
>
> Regards,
>
> Vivien

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:

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

Is this the best solution?

Thanks for the help,

Patrick


_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to