The plugin was compiled and installed as here qt-project.org.
libqt5sql5-mysql was installed
mysql-client was installed
Code:
QPluginLoader loader("path-to-your-driver/libqsqlmysql.so");
loader.load();
qDebug() << loader.errorString();
shows
"Unknown error"
output from qDebug() << QSqlDatabase::drivers();
"QSQLITE", "QMYSQL", "QMYSQL3", "QPSQL", "QPSQL7"
I have
$ls -l /Qt/5.4/gcc_64/plugins/sqldrivers/
libmysqlclient.so.18.1.0
libqsqlite.so
libqsqlmysql.so
libqsqlpsql.so
and
$ldd libqsqlmysql.so
linux-vdso.so.1 => (0x00007fff381bf000)
libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 (0x00007f67e891a000)
libQt5Sql.so.5 => /home/maxim/Qt/5.4/gcc_64/lib/libQt5Sql.so.5 (0x00007f67e86da000)
libQt5Core.so.5 => /home/maxim/Qt/5.4/gcc_64/lib/libQt5Core.so.5 (0x00007f67e7f9d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f67e7c99000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f67e78d3000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f67e76b9000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f67e74b5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f67e7297000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f67e6f90000)
libicui18n.so.53 => /home/maxim/Qt/5.4/gcc_64/lib/libicui18n.so.53 (0x00007f67e6b44000)
libicuuc.so.53 => /home/maxim/Qt/5.4/gcc_64/lib/libicuuc.so.53 (0x00007f67e67b9000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f67e65b6000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f67e63ae000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f67e60a6000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f67e5e8f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f67e9086000)
libicudata.so.53 => /home/maxim/Qt/5.4/gcc_64/lib/libicudata.so.53 (0x00007f67e4807000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f67e45c8000)
Related
I have a problem with my Slider::widget
use kartik\slider\Slider;
.
.
.
<?=Slider::widget([
'name' => 'price',
'value' => isset($_GET['price']) ? $_GET['price'] : '0,2000',
'sliderColor' => "#2583ee",
'handleColor' => "#2583ee",
'pluginOptions' =>[
'min' => 0,
'max' => 2000,
'step' => 5,
'range' => true,
'tooltip' => 'always'
],
]);?>
I already installed kartik slider using composer
$ php composer.phar require kartik-v/yii2-slider "dev-master"
But it's sill showing me
Undefined type 'kartik\slider\Slider'.intelephense(1009)
I made sure that's in the composer.json
But it's still showing the error
Not able to connect MySQL... detail given bellow.
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Filename: mysqli/mysqli_driver.php
Line Number: 202
Backtrace:
File: /var/www/html/application/controllers/Account.php
Line: 7
Function: __construct
File: /var/www/html/index.php
Line: 315
Function: require_once
First you need to download xampp and ensure that my sql services on or off .if it is on then you are write function mysqli_connect(‘localhost’,’username’,’password’,’database’);
I guess you have a xampp installed in your system and SQL service was enabled.
If yes, then create one database file in your application/config folder. Filename is database.php
Here you need to give a default db driver variable, likewise
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'your-db-username',
'password' => 'your-db-password',
'database' => 'your-db-name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Next, you need to load this database.php config file in autoload.php (in the same directory).
$autoload['libraries'] = array('database');
Now, you have connected a database with your Codeigniter project.
Reference : https://www.codeigniter.com/userguide3/database/configuration.html
I am getting this error when I add the configuration to Laravel/Lumen to connect by ssl to the MySQL server.
2018-05-16 10:42:45] lumen.ERROR: exception 'ErrorException' with message 'PDO::__construct(): this stream does not support SSL/crypto' in /var/www/project/vendor/illuminate/database/Connectors/Connector.php:56
I checked the installed php modules. It shows that openssl is installed with php -m and that php-mysqlnd is installed.
This is my configuration:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 3306),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => env('DB_PREFIX', ''),
'timezone' => env('DB_TIMEZONE', '+00:00'),
'strict' => false,
'options' => array(
PDO::MYSQL_ATTR_SSL_KEY => '/etc/ssl/certs/mysqlssl/key.pem',
PDO::MYSQL_ATTR_SSL_CERT => '/etc/ssl/certs/mysqlssl/cert.pem',
PDO::MYSQL_ATTR_SSL_CA => '/etc/ssl/certs/mysqlssl/ca-cert.pem',
),
And showing that mysql has ssl running:
Turns out can't use localhost or it won't use TCP/IP and instead it will use unix sockets which don't use SSL.
I am getting an error. Local it works, but not on production.
Does anyone have an idea?
PHP Version 7.1.14-1+ubuntu16.04.1+deb.sury.org+1
Mysql Version 5.7.21
Error:
production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Undefined class constant ‘MYSQL_ATTR_LOCAL_INFILE’ in /data/www/xxx/config/database.php:50
Database:
'default' => [
'driver' => 'mysql',
'host' => env('DB_HOST'),
'port' => env('DB_PORT'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
'options' => array(
\PDO::MYSQL_ATTR_LOCAL_INFILE => true,
),
],
Install or enable PDO module using these commands
sudo apt-get install php7.1-mysql
sudo phpenmod pdo_mysql
sudo service apache2 restart
When executing the following code I get an error that the Mysql driver is not loaded:
db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("127.0.0.1");
db.setDatabaseName("test");
db.setUserName("test");
db.setPassword("test");
if (!db.open()) {
QMessageBox::critical(0, QObject::tr("Database Error"), db.lastError().text());
} else
qDebug() << "OPEN";
and in my .pro file I added it with
QT += core gui sql
I'm using Ubuntu 15.10 and I have installed
libqt5sql5-mysql
libqt4-sql-mysql
and when locating them with I get
locate libqsql
/usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers/libqsqlmysql.so
/usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/libqsqlite.so
/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so
also when running the ldd command all dependencies can be found:
ldd libqsqlite.so
linux-vdso.so.1 => (0x00007fff631e6000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f831f6d3000)
libQt5Sql.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Sql.so.5 (0x00007f831f691000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f831f1d4000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f831ee52000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f831ea88000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f831e869000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f831e665000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f831e44b000)
libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f831dfe7000)
libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f831dc53000)
libpcre16.so.3 => /usr/lib/x86_64-linux-gnu/libpcre16.so.3 (0x00007f831d9f0000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f831d6e0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f831d4d8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f831d1d0000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f831cfb8000)
/lib64/ld-linux-x86-64.so.2 (0x0000557933e71000)
libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f831b501000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f831b293000)
When executing the code I get as output:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QPSQL QPSQL7
Do I need to do something else?