I have fired this query "# echo "select 1" | isql -v asterisk-connector" got error:
[01000][unixODBC][Driver Manager]Can't open lib
'/usr/lib64/odbc/libmyodbc.so' : file not found [ISQL]ERROR: Could not
SQLConnect
tried to Installing and Configuring ODBC
like wise
sudo apt-get install unixODBC unixODBC-dev
This is the configuration of ODBC for MySQL in /etc/odbcinst.ini:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
FileUsage = 1
why don't you try installing:
asterisk-addons - An addons package, which includes MySQL support for call detail records
A guide how to use it:
http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL
You need reinstall ODBC Driver and make an appropiate link to driver libraries.
Here are the full details:
https://blog.onesconsultants.com/2018/08/troubleshooting-odbc-module-in-asterisk.html
Related
I'm new to using database connections with R (under Ubuntu 16.04), and am running into some trouble. Following the documentation I've seen online, I tried something like this:
con <- DBI::dbConnect(RMySQL::MySQL(),
dbname='IFsHistSeries',
host='127.0.0.1')
This got me an error message that read:
Failed to connect to database: Error: Can't initialize character set unknown (path: compiled_in)
From what I was able to find using the google, it seems that RMariaDB is more up-to-date than RMySQL, so I gave that a shot instead:
con <- DBI::dbConnect(RMariaDB::MariaDB(),
dbname='IFsHistSeries',
host='127.0.0.1')
This resulted in an equally-cryptic error message:
Failed to connect: Plugin caching_sha2_password could not be loaded:
So then I tried something really foolish -- installing MariaDB using the instructions at https://downloads.mariadb.org/mariadb/repositories/. There were some dependency problems that managed to completely break MySQL so that now nothing works at all anymore. I'm planning to completely uninstall MySQL and MariaDB and start over from scratch. What I want to know for next time is:
Do I need to install MariaDB? Or will ordinary MySQL work with RMariaDB? (The relationship between the two databases confuses me a little.)
Do I need to do something special when setting up MySQL to make sure that the caching_sha2_password plugin works? I'm worried that this has something to do with the way I initially set up the password for my root user.
Any ideas at all would help a lot. Thanks!
--craig
OK... this seemed to work. First, I removed MySQL and MariaDB and installed 8.0.12 MySQL using the download from https://dev.mysql.com/downloads/mysql/ and followed instructions at https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html.
I uninstalled all of my drivers and just reinstalled unixODBC
sudo apt-get remove unixodbc unixodbc-dev tdsodbc odbc-postgresql libmyodbc libsqliteodbc
sudo apt-get install unixodbc unixodbc-dev
Things went awry before when I installed libmariadbclient-dev. Instead, I ran
sudo apt-get install libmariadb-client-lgpl-dev
This installed the MariaDB client without breaking MySQL. I really don't know what the difference between the two is.
To get rid of the error with the caching_sha2_password plugin, I needed to change the default authentication mode when starting the MySQL server:
sudo ./mysqld_safe --user=mysql --default-authentication-plugin=mysql_native_password &
At this point, I could run
con <- dbConnect(RMariaDB::MariaDB(),
host='127.0.0.1',
user='root',
password='password')
Without any trouble.
I need to connect my HANA Express VM with a MySQL database. What I did so far is:
0.) Registered VM and installed unixODBC (as described in Youtube Playlist)
1.) Downloaded ODBC driver installation files (rpm)
2.) sudo zypper install
3.) myodbc-installer -d -l
4.) cp /etc/unixODBC/odbc.ini ~/.odbc.ini
5.) cp /etc/unixODBC/odbcinst.ini ~/.odbcinst.ini
6.) nano ~/.odbc.ini
[ODBC Data Sources]
ds2 = myodbc5w
ds1 = myodbc5a
Default = Default
[myodbc5w]
Driver = /usr/lib64/libmyodbc5w.so
DATABASE = <sqldb>
DESCRIPTION = MySQL ODBC 5.3 Unicode Driver test
SERVER = <sqlip>
UID = <sqluser>
USER = <sqluser>
PASSWORD = <pw>
[myodbc5a]
Driver = /usr/lib64/libmyodbc5a.so
DATABASE = <sqldb>
DESCRIPTION = MySQL ODBC 5.3 ANSI Driver test
SERVER = <sqlip>
UID = <sqluser>
USER = <sqluser>
PASSWORD = <pw>
[Default]
Driver = /usr/lib64/libmyodbc5a.so
DATABASE = <sqldb>
DESCRIPTION = MySQL ODBC 5.3 ANSI Driver test
SERVER = <sqlip>
UID = <sqluser>
USER = <sqluser>
PASSWORD = <pw>
7.) nano ~/.odbcinst.ini
[MySQL ODBC 5.3 Unicode Driver]
Driver=/usr/lib64/libmyodbc5w.so
UsageCount=1
[MySQL ODBC 5.3 ANSI Driver]
Driver=/usr/lib64/libmyodbc5a.so
UsageCount=1
[Default]
Driver=/usr/lib64/libmyodbc5a.so
UsageCount=1
8.) nano ~/.customer.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
export ODBCINI=$HOME/.odbc.ini
export ODBCSYSINI=$HOME
9.) Restarted VM
10.) I can successfully connect by calling
isql myodbc5w <user> <pw>
11.) Also this call works
myodbc-installer -d -l
MySQL ODBC 5.3 Unicode Driver
MySQL ODBC 5.3 ANSI Driver
Default
Now my problem and questions:
Why won't also my Smart Data Access access the MySQL (it seems to connect, but can't list the tables)? And what shall I set the "Configuration File" property with? And what's wrong with the odbc / odbcinst files, that only "Default" works?
I adapted the odbc file from an example which was shipped with the ODBC installation...
See screenshot for my SDA settings (only "Default" data source worked for me yet).
I'm working for days now on this problem, any help is appreciated! Thanks!
I resolved the same issue. I installed mariadb connector (not MySQL connector):
https://mariadb.com/kb/en/about-mariadb-connector-odbc/
wget https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.7/mariadb-connector-odbc-3.1.7-ga-rhel7-x86_64.tar.gz
tar -xvzf mariadb-connector-odbc-3.1.7-ga-rhel7-x86_64.tar.gz
cp lib/libmaodbc.so /lib64/
Next, i made an entry for Maria in .odbc.ini
[Maria]
Description = MariaDB 3.1.7 ODBC
Driver = /lib64/libmaodbc.so
SERVER = <your server>
and then:
enter image description here
I have two systems. my first system is ubuntu 16.04. which, work as remote.
and another is centos 6. which, run in virtually. In centos, freeswitch installed. I have to send data from freeswitch to remote system means ubuntu.
on centos, my configuration of odbc.ini as :
[freeswitch]
DRIVER = /usr/lib64/libodbcmyS.so
SERVER = <ipaddress>
USER = root
PASSWORD = <password>
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
and odbcinst.int as below:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib64/libmyodbc.so
Setup = /usr/lib64/libodbcmyS.so
FileUsage = 1
Threading = 0
after setup above code.
I have to check odbc connection. for this, command fire as :
isql -v freeswitch
but, it show error as :
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect
wrong driver description arise this type of error.
I have set proper driver description. wrongly, setup description mention in driver field.
I think you need to change the line
DRIVER = /usr/lib64/libodbcmyS.so
to
DRIVER = MySQL
Thanks.
I use the following code to connect to a MySQL server database.
QSqlDatabase db_Server = QSqlDatabase::database("Test");
//find mysql driver
db_Server = QSqlDatabase::addDatabase("QMYSQL","Test");
db_Server.setHostName("188.**.***.***");
db_Server.setPort(3306);
db_Server.setDatabaseName("Test");
db_Server.setUserName("Test");
db_Server.setPassword("*********");
bool ret = db_Server.open();
if(ret) qDebug() << "Database open"
else qDebug() << db_Server.lastError().text();
Lately they changed the server to mariadb and I assumed it was compatible with QMYSQL driver and used the above code to access the database, but I get the following error
"Can't connect to MySQL server on '188..*.***' (101) QMYSQL: Unable to connect"
Is there any additional thing that I need to do with mariadb to connect to the server? Any help is appreciated
I had built the MySQL plugin the following way
#sudo apt-get install libmysqlclient-dev
#cd $QTDIR/src/plugins/sqdrivers/mysql
#sudo qmake “INCLUDEPATH+=usr/include/mysql” “LIBS+=-L/usr/lib/i386-linux-gnu –lmysqlclient_r” mysql.pro
#sudo make
#sudo make install
Should I do any changes for mariadb similarly?
It was a problem with the database and not the Qt application, the connection refused if a password was used.
I'm a little green at this, and I hope the issue I'm having is a simple one...edit: new information at bottom
I need to make a connection to a remote mysql (Amazon RDS) database.
After following a few tutorials, I have unixodbc and libmyodbc installed and configured on the client, but when I try to connect via isql, I get the error
[08S01][unixODBC][MySQL][ODBC 5.1 Driver]Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ISQL]ERROR: Could not SQLConnect
The most confusing part about this error is that I'm not trying to connect to a local database, but rather to a remote one. I do not have a mysql.sock file on the client...this isn't the issue though is it?
I'm sensing a configuration error but I'm just not sure what it could be.
If I run odbcinst -j then the output is:
DRIVERS............: /etc/unixODBC/odbcinst.ini
SYSTEM DATA SOURCES: /etc/unixODBC/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini
The content of /etc/unixODBC/odbcinst.ini is:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib64/libmyodbc5.so
Setup = /usr/lib64/unixODBC/libodbcmyS.so
UsageCount = 5
[MySQL ODBC 515 Driver]
Description = ODBC 5.515 for MySQL
DRIVER = /usr/lib64/libmyodbc5-5.1.5.so
SETUP = /usr/lib64/unixODBC/libodbcmyS.so
UsageCount = 3
Please note that I had to make up this configuration myself, I did a find for libmyodbc* and found these two .so files, thus set up a driver for each of them. A search for libodbcmyS* yields:
/usr/lib64/unixODBC/libodbcmyS.so.1
/usr/lib64/unixODBC/libodbcmyS.so
/usr/lib64/unixODBC/libodbcmyS.so.1.0.0
So, I don't know what else that configuration could be.
The content of /etc/unixODBC/odbc.ini is:
[target_db]
Driver = MySQL
Server = [servername.com]
Port = 3306
Database = [databasename]
Option = 2
User = [username]
Password = [password]
I've tried different options in "Driver", changing it from MySQL, to MySQL ODBC 515 Driver, to the path to the .so file (eg: /usr/lib64/libmyodbc5.so) and all yield the same result.
I'm running:
odbcinst -i -d -f /etc/unixODBC/odbcinst.ini
Followed by:
odbcinst -i -s -l -f /etc/unixODBC/odbc.ini
Followed by:
odbcinst -s -q
Which prints out the name of my connection, ie [target_db]
Then, I try the connect:
isql -v target_db user password
or just
isql -v target_db
and get the error shown above.
Anyone happen to know what I'm doing wrong here? Thanks a bunch-
EDIT:
Wanted to mention that I'm able to connect to the database from this server using the mysql command line tools.
I installed a local mysql database, and I'm able to connect to this using isql. It seems to be ignoring my odbc.ini file entirely, i have to enter a name with the command, ie isql -v test-database, but it still tries to connect to localhost despite my settings.
I feel as though I've tried everything but will keep at it and will post if i find a solution.
You could try to connect using the ip of your server instead of the dns entry on the "Server" line of odbc.ini.. Have you verified the driver is installed with phpinfo()?
Try to set the environment variable ODBCINI with the path of your odbc.ini file.
Keep in mind that the odbc.ini file you point to must be "write-accessible" by the user that is running the program (i.e. the user must have permissions to write in this file).
chmod g+w .odbc.ini did it for me since we run the DB with ORACLE-Start and the crs-User seems to be in charge