I try to use the MySQL module from QT but without result, the module is present but Qt does not load it. I have this error
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
QSqlError("", "Driver not loaded", "Driver not loaded")
if I make a ldd libqsqlmysql.so I get this result
linux-vdso.so.1 (0x00007ffe89950000)
libmysqlclient_r.so.16 => not found
libQt5Sql.so.5 => /opt/Qt/5.4/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007fdc67aaf000)
libQt5Core.so.5 => /opt/Qt/5.4/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007fdc67372000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdc6706b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdc66cc2000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdc66aa4000)
libicui18n.so.53 => /opt/Qt/5.4/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.53 (0x00007fdc66658000)
libicuuc.so.53 => /opt/Qt/5.4/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.53 (0x00007fdc662cd000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdc660c8000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fdc65ec6000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fdc65cbe000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fdc659c5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdc656c4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdc654ae000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdc67f1c000)
libicudata.so.53 => /opt/Qt/5.4/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.53 (0x00007fdc63e25000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fdc63be8000)
the problem is I think this line libmysqlclient_r.so.16 => not found
If I make a locate mysqlclient I get this reuslt
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18.0.0
/usr/share/doc/libmysqlclient18
/usr/share/doc/libmysqlclient18/NEWS.Debian.gz
/usr/share/doc/libmysqlclient18/changelog.Debian.gz
/usr/share/doc/libmysqlclient18/changelog.gz
/usr/share/doc/libmysqlclient18/copyright
/var/cache/apt/archives/libmysqlclient18_5.5.43-0+deb7u1_amd64.deb
/var/cache/apt/archives/libmysqlclient18_5.5.44-0+deb7u1_amd64.deb
/var/lib/dpkg/info/libmysqlclient18:amd64.list
/var/lib/dpkg/info/libmysqlclient18:amd64.md5sums
/var/lib/dpkg/info/libmysqlclient18:amd64.postinst
/var/lib/dpkg/info/libmysqlclient18:amd64.postrm
/var/lib/dpkg/info/libmysqlclient18:amd64.shlibs
I read about some forum, the need to make a symbolic link I tried but I always this error
Assuming that for getting this error you installed Qt from the binary packages downloaded from qt.io:
Install the MySQL client dev packages
Run the MaintenanceTool (somewhere where you installed Qt)
Ask it to install extra packages
Install the "Source Components" for at least the Essential modules
Go to /dir/where/you/installed/Qt/version/Source/
Go into qtbase/src/plugins/sqldrivers/mysql
Run qmake from the very same Qt version (/dir/where/you/installed/Qt/version/arch/bin/qmake or similar)
Run make, if it explodes with headers/libraries not found check that you installed those MySQL client dev packages correctly
That should give you a brand new plugin, and with fingers crossed, it's already put in the right place. Otherwise find the new libqsqlmysql.so, ldd it to be sure it was OK, and overwrite the old plugin with the new one.
I finally found a solution to my problem, so I have download libmysqlclient16 from libmysqlclient16 Debian amd64
After I made dpkg -i libmysqlclient16_5.1.73-1_amd64.deb
I restart and I compile my Qt project and I could not error
I know it is an old question, but I had the same issue with a slightly different solution probably due to Qt updates since then.
I will provide the solution that worked for me running Fedora 26 with kernel 4.13 and Qt 5.9.1
Find your path to Qt installation and let's call it here QTDIR.
In my case it is installed at /home/Qt5. So QTDIR = /home/Qt5/
My version is 5.9.1. Therefore I also have a folder "5.9.1" in QTDIR and I will call it "version" folder as Pepe did above.
The last folder that depends on your installation is the compiler folder. In my case it is gcc_64 inside QTDIR/version/
Now that you located yourself, let's go the procedure to install the drivers for Qt.
1) If your linux distribution doesn't come with SQL headers installed you must install them first. In Fedora I istalled the community-mysql-devel
> sudo dnf install community-mysql-devel
You must search and the install the appropriate SQL package for your distro. Just remember that the main idea is to install some development package in order to access the headers.
2) The second thing you need to do is to make sure you had installed Qt with the sources directory.
Check if you have the foulder $QTDIR/version/Src. If you have not, then run the maintenance tool in QTDIR and add Src foulder by checking the "sources" option under the kit you had installed (or wish to install).
3) Then go to where the sqldrivers should be by typing in your terminal
> cd yourQTDIR/yourVersion/Src/qtbase/src/plugins/sqldrivers
and run on terminal:
> make
> make install
This should create the drivers libqsqlite.so and libqsqlmysql.so in the folder: yourQTDIR/yourVersion/yourCompiler/plugins/sqldrivers
We then move to update a path to the sql headers as described in the official site http://doc.qt.io/qt-5/sql-driver.html, but with a slightly difference in the path to mysql headers (you must verify the proper folders in your OS). In my case MYSQL headers are in /usr/lib64.
Go to
> cd yourQTDIR/yourVersion/Src/qtbase/src/plugins/sqldrivers/mysql
Then run
> yourQTDIR/yourVersion/yourCompilerFolder/bin/qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib64 -lmysqlclient_r" mysql.pro
> make
> make install
This should do the trick.
4) Now go to "yourQTDIR"/"yourVersion"/"yourCompiler"/plugins/sqldrivers
and run
> ldd libqsqlmysql.so
This will allow you to check if there is any missing link and direct you to a more specific solution to your case.
In a couple of Qt versions from now the procedure above may change. However the main points to keep in mind are that 1) you must have the MYSQL headers installed; 2) you must create the plugin by running make and make install in some source folder for MYQSL, and 3) you must update the path to MYSQL headers in order to Qt to find it.
Related
I am running Yii2 on Ampps on Windows and I have installed https://github.com/yiisoft/yii2-queue
I am just trying to setup the supplied example but I am unable to even get that working.
What's happening is that when I run
Yii::$app->queue->push(new QueueLeadEmailJob([
'url' => 'https://previews.123rf.com/images/fordzolo/fordzolo1506/fordzolo150600296/41026708-example-white-stamp-text-on-red-backgroud.jpg',
'file' => 'C:\Program Files (x86)\Ampps\www\websitedomain.com\41026708-example-white-stamp-text-on-red-backgroud.jpg',
]));
I am getting the correct value added to the queue table. When I run yii queue/run in the command line I get
2018-09-11 08:36:37 [pid: 4144] - Worker is started
2018-09-11 08:36:37 [3] common\components\queues\QueueLeadEmailJob (attempt: 1, pid: 4144) - Error
> Symfony\Component\Process\Exception\ProcessFailedException: The command "C:\Program Files (x86)\Ampps\php-7.1\php.exe C:\Program Files (x86)\Ampps\www\websitedomain.com\hub\yii queue/exec "3" "300" "1" "4144" --verbose=1 --color=" failed.
2018-09-11 08:36:37 [pid: 4144] - Worker is stopped (0:00:00)
I can see the error but I don't know how to resolve it. I have searched but (obviously) have not found a solution. After running yii queue/run the queue table is cleared so it seems like the queue is working...but no file is downloaded.
I have checked the permissions on the folder and it has write permissions.
Anyone have any ideas?
It looks like this bug. It was already fixed in master, but not released yet. You may use master branch until version 2.1.1 will be released.
composer require yiisoft/yii2-queue:dev-master
I'm trying to link MySQL with a different glibc that provides e.g. a different pthread implementation and actually thought I got it right a few days ago.
Obviously, I took notes and wanted to reproduce the outcome but I can't get it to link properly, so I must have forgotten a step.
What I did previously was simply to add the flags pointing to my glibc and the default one second to the cmake command.
GLIBC_FLAGS="-Wl,--rpath=/path/to/my/glibc/build/lib:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu -Wl,--dynamic-linker=/path/to/my/glibc/build/lib/ld-linux-x86-64.so.2
cmake \
-DCMAKE_INSTALL_PREFIX=../install \
.. \
-DCMAKE_C_FLAGS="$GLIBC_FLAGS" \
-DCMAKE_CXX_FLAGS="$GLIBC_FLAGS"
These flags work when building a simple a test-program but seem not to work with MySQL as ldd reports the default glibc for mysqld.
$ ldd install/bin/mysqld
linux-vdso.so.1 => (0x00007fff14ffe000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f4f1c9bb000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f1c7b7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4f1c599000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4f1c295000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4f1bf91000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4f1bd7a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f1b9b2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4f1cc13000)
I also tried to set the LD_LIBRARY_PATH and changing the linker flags and lib variables in BUILD/scripts/mysql_config but none of these seem to work.
What is necessary to link MySQL against a different glibc?
ldd reports the default glibc for mysqld.
You should not trust ldd -- it uses default loader -- /lib64/ld-linux-x86-64.so.2 which is not the loader you've compiled your musqld to use.
Instead, run your mysqld under GDB and do start followed by info shared. You will likely see that in fact your version of glibc is actually loaded.
After a Kernel-Update, cmake apparently ignored the DCMAKE_CXX_FLAGS and DCMAKE_C_FLAGS if they contained a colon-separated list of paths (the options were used when they contained only a single path).
I worked around this by setting the colon-separated pathlist directly in the CMakeLists.txt in the MySQL root directory.
(This is a cross-post from ask.puppetlabs.com)
I am setting up a centos6.4 VM using Vagrant and Puppet. First off, my familiarity is with Debian linux and also I am new to Puppet, so sorry if I am missing something basic...
I am using the mysql module from puppetlabs, and the default version of mysql installed is 5.1 but I'd like to install 5.5.
From this post, it looks like I need to grab mysql5.5 from some extra repos,
My Puppetfile looks like:
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/stdlib'
mod 'puppetlabs/apache'
mod 'puppetlabs/mysql'
I added a yumrepo declaration
yumrepo {
'epel':
descr => 'Extra Packages for Enterprise Linux 6 - $basearch',
enabled => "1",
gpgcheck => "1",
failovermethod => 'priority',
gpgkey => "http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm",
;
'remi':
descr => 'Extra Packages for Enterprise Linux 6 - $basearch',
enabled => "1",
gpgcheck => "1",
failovermethod => 'priority',
gpgkey => "http://rpms.famillecollet.com/enterprise/remi-release-6.rpm",
;
}
If I add package_ensure with the targeted version,
class { '::mysql::server':
package_ensure => "5.5.36-1.el6.remi",
}
I can see that puppet tries to install that package, but mysql5.1 has already been installed by that point and there are dependencies that conflict. I've tried searching for a good approach, but am not familiar enough with puppet yet to know what to look for.
Thanks for the help
first to install mysql 5.5 you have remove mysql 5.1 add the following lines init.pp and moreover epel repo will not not install 5.5 on your system you need to install it with rpm of mysql to install it with rpm use add the following lines in int.pp file
package { 'mysql-libs':
ensure => 'purged',
}
package { 'MySQL-server-5.5.8-1.rhel5.x86_64':
provider => 'rpm',
ensure => installed,
source => "/path_to_dir/MySQL-server-5.5.8-1.rhel5.x86_64.rpm",
require => Package['mysql-libs'],
}
I am trying to install rasqal 0.9.20 library http://librdf.org/rasqal/ onto a windows 7 machine with cygwin.Earlier i have successfully installed the raptor-2.2.0 library http://librdf.org/raptor/ and i can verify this with the rapper tool was created after the installation(./configure , ./make ,/make install)
The error that i am getting from the configuration of rasqal is :
./configure --enable-raptor2
...
checking for raptor... configure: error: Raptor2 is not installed - see http://librdf.org/raptor/ to get a version newer than 1.9.0
I can't find a way to fix it. The code from the cofigure file that handles this flag is the below :
11840 # raptor is REQUIRED despite the checking here
11841 RAPTOR_MIN_VERSION=1.4.19
11842 RAPTOR_MAX_VERSION=1.8.99
11843 RAPTOR2_MIN_VERSION=1.9.0
11844
11845 raptor2=no
11846 # Check whether --enable-raptor2 was given.
11847 if test "${enable_raptor2+set}" = set; then :
11848 enableval=$enable_raptor2; raptor2="$enableval"
11849 else
11850 raptor2="no"
11851 fi
Raptor 2.0.0 uses only pkg-config to provide configuration information, raptor-config was removed. The same applies to rasqal itself, the rasqal-config program will go away at some point. The --enable-raptor2 option to rasqal and librdf was for testing the beta raptor2, and it has been removed from rasqal 0.9.22 and librdf GIT head.
Set PKG_CONFIG_PATH to include the correct path:
env PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure
Another method, if available on your system, is to define the environment variable in /etc/environment:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
I'm attempting to get DBD::MySQL working on Snow Leopard (v10.6.6). The default version of Perl that comes with the OS is v5.10.0. Since I've read that's 64-bit, I went ahead and downloaded and installed a 64-bit version of MySQL (mysql-5.5.8-osx10.6-x86_64).
Installing and setting up MySQL went smoothly, here's my config and version number for reference.
I used CPAN to download DBI and the DBD::MySQL drivers. I then:
Installed DBI
Setup a Makefile.PL
Ran the make command from the command line
The Makefile.PL said it would use the following settings for compiling and testing:
I will use the following settings for compiling and testing:
cflags (mysql_config ) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64
embedded (mysql_config ) =
libs (mysql_config ) = -L/usr/local/mysql/lib -lmysqlclient -lpthread
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (User's choice) = r00t!
testsocket (default ) =
testuser (User's choice) = root
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 907
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Everything seemed to be going fine, until I tried to run make test :
t/00base....................NOK 2/6# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
# Referenced from: /Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle
# Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9
It's failing because it can't seem to find the mysql.bundle for DBD. Has anyone come across this problem? Or can point me in the right direction on what to try next? I need DBI/DBD::MySQL for my new job and I'm scrambling to find a solution.
Many thanks in advance.
I got around the "Library not loaded: libmysqlclient.16.dylib" problem by placing a symbolic link in /usr/lib/" to /usr/local/mysql-5.5.8-osx10.6-x86_64/lib/libmysqlclient.16.dylib
I worked around the same or a similar issue. Somehow I could build and test DBD::mysql with cpan but when I tried to use it in a script it said things like
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: flat namespace
Apparently, it's a 64-bit vs 32-bit issue.
Installing the fink dbd-mysql-pm5100 package made it work though it took kind of a long time. I also removed the cpan-installed version:
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql
sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD/mysql.pm
also include in .profile
export VERSIONER_PERL_PREFER_32_BIT=yes;
Besides creating the link the executions of the program with DBI::mysql generated an error, thus including this variable on the environment make it works
I know this is an old post. But I suppose the best solution would be to add the library directory to the DYLD_FALLBACK_LIBRARY_PATH env variable. (reason here: https://stackoverflow.com/a/3172515/119958 )
There is no ldconfig in mac, so just add the path to this env var and rerun the install process for DBD::mysql
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... FAIL
! Installing DBD::mysql failed. See /Users/donato/.cpanm/build.log for details.
# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/donato/.cpanm/work/1359948144.491/DBD-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib
Donato-Vianas-MacBook-Pro:Invoicer donato$ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
Donato-Vianas-MacBook-Pro:Invoicer donato$ cpanm DBD::mysql--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.022.tar.gz ... OK
Configuring DBD-mysql-4.022 ... OK
Building and testing DBD-mysql-4.022 ... OK
Successfully installed DBD-mysql-4.022
1 distribution installed
Donato's solution works for install, but the var has to be present at runtime as well or I get the same error. The following fixes this at runtime for shell and _www user:
# For command line use, add following line to ~/.bash_profile:
export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
# If Apache needs it, add following line to /etc/apache2/httpd.conf:
# On Lion Server, I put it after <IfDefine MACOSXSERVER>, but shouldn't matter
SetEnv DYLD_FALLBACK_LIBRARY_PATH /usr/local/mysql/lib/:$DYLD_FALLBACK_LIBRARY_PATH
It's somewhat of an aside, but I strongly recommend setting up a separate perl on the machine -- either by fink / macports, or from source -- and leaving the Mac's system perl (and its libraries) alone.
Once I did this on my own Mac, I had very few troubles installing modules thereafter, and I didn't have to worry about accidentally blowing a hole in my OS by breaking the perl that the system uses.
If it were my Mac, I'd install a new perl from source (the Perl source distribution is smart enough to install itself see that it's on a Mac and install itself safely into /usr/local/bin) and the proceed from thee to install DBD::Mysql (and the other modules you require).