Bug #75047 | mysql_library_init failure after upgrading mysql | ||
---|---|---|---|
Submitted: | 29 Nov 2014 11:11 | Modified: | 19 Feb 2015 20:22 |
Reporter: | Oliver Foo | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Embedded Library ( libmysqld ) | Severity: | S3 (Non-critical) |
Version: | 5.6.21 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | config, embedded |
[29 Nov 2014 11:11]
Oliver Foo
[29 Nov 2014 14:24]
MySQL Verification Team
related: http://bugs.mysql.com/bug.php?id=39693 (error reporting for mysql_library_init)
[27 Jan 2015 20:37]
Sveta Smirnova
Thank you for the report. I tried to simplify test case and removed all QT-related parts and could not repeat described behavior. Could you please try my test case and inform if it files in your environment: #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include "mysql.h" MYSQL *mysql; int main() { setenv("MYSQL_HOME", "/home/ssmirnov/blade12/src/bugs", 1); setenv("DEFAULT_HOME_ENV", "/home/ssmirnov/blade12/src/bugs", 1); char** mysql_args=new char*[1]; mysql_args[0]="test"; if (int OK = mysql_library_init(1, mysql_args, NULL)) { printf("Return code: %d, Error: %s", OK, mysql_error(mysql)); exit(OK); } mysql = mysql_init(NULL); } $cat my.cnf [embedded] datadir = /home/ssmirnov/blade12/src/bugs/bug75047 default-storage-engine = MyISAM loose-innodb = 0 skip-grant-tables = 1 myisam-recover = BACKUP,FORCE key_buffer_size = 16777216 character-set-server = utf8 collation-server = utf8_bin
[7 Feb 2015 10:20]
Oliver Foo
Thank you for the code example, I've tested it (changed the paths to my db dir) and it works fine with mysql 5.5 and 5.6 on my environment. I guess something in my Qt wrapper or the way CMake compiles my files is wrong , then.
[7 Feb 2015 13:59]
Oliver Foo
I found my problem: It had nothing to do with Qt, but with a missing environment variable: LD_LIBRARY_PATH="/usr/lib64/mysql" when running the Qt application from within Eclipse. I guess the init function simply couldn't find its library.
[19 Feb 2015 20:22]
Sveta Smirnova
Thank you for the feedback. Closing as "Not a Bug".