Issue with my odbc connector 8.0 that connects to mysql8 in centos7 - centos7

I tried to connect using isql command (Both are AWS EC2)
# isql -v WebDB
[S1000][unixODBC][MySQL][ODBC 8.0(w) Driver]Can't connect to MySQL server on 'ip:3306' (110)
[ISQL]ERROR: Could not SQLConnect
But I can able connect manually
~**]# mysql -h ip -u useranme -p $pwd**
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 304
Server version: 8.0.29 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
I tried to restart opensips that need to connect remote mysql8
/usr/local/sbin/opensips[2905]: ERROR:db_mysql:db_mysql_connect: driver error(2003): Can't connect to MySQL server on 'ip'
/usr/local/sbin/opensips[2905]: ERROR:db_mysql:db_mysql_new_connection: initial connect failed
/usr/local/sbin/opensips[2905]: ERROR:core:db_do_init: could not add connection to the pool
[2905]: ERROR:dialog:init_dlg_db: unable to connect to the database
/usr/local/sbin/opensips[2905]: ERROR:dialog:mod_init: failed to initialize the DB support

Related

Percona AWS RDS Database Backup

I am trying to take a single database backup from AWS RDS through Percona XtraBackup. But it is failing in identifying the rdsdata. I am using Mac.
The command I used-
xtrabackup --host='awsserv-staging.fbyvwz.eu-east-2.rds.amazonaws.com' --port=3306 --user='myusername' --password='myPassword' --backup --databases=db-purchases --target-dir=/Users/myuserdir/percona-xtrabackup --no-lock --datadir=innodb_data_home_dir=/rdsdbdata/db/innodb;
The error I am getting is -
xtrabackup: recognized server arguments: --datadir=innodb_data_home_dir=/rdsdbdata/db/innodb
xtrabackup: recognized client arguments: --host=awsserv-staging.fbyvwz.eu-east-2.rds.amazonaws.com --port=3306 --user=myusername --password=* --backup=1 --databases=db-purchases --target-dir=/Users/myuserdir/percona-xtrabackup --no-lock=1
/opt/homebrew/Cellar/percona-xtrabackup/8.0.27-19/libexec/bin/xtrabackup version 8.0.27-19 based on MySQL server 8.0.27 macos12.2 (arm64) (revision id: 50dbc8dadda) 220510 15:50:47 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=awsserv-staging.fbyvwz.eu-east-2.rds.amazonaws.com;port=3306' as 'myusername' (using password: YES).
220510 15:50:48 version_check Connected to MySQL server
220510 15:50:48 version_check Executing a version check against the server...
220510 15:50:48 version_check Done.
220510 15:50:48 Connecting to MySQL server host: awsserv-staging.fbyvwz.eu-east-2.rds.amazonaws.com, user: myusername, password: set, port: 3306, socket: not set Using server version 8.0.23
Warning: option 'datadir' points to nonexistent directory 'innodb_data_home_dir=/rdsdbdata/db/innodb'
Warning: MySQL variable 'datadir' points to nonexistent directory '/rdsdbdata/db/'
Warning: option 'datadir' has different values:
'innodb_data_home_dir=/rdsdbdata/db/innodb' in defaults file
'/rdsdbdata/db/' in SHOW VARIABLES
xtrabackup: Can't change dir to 'innodb_data_home_dir=/rdsdbdata/db/innodb' (OS errno 2 - No such file or directory) xtrabackup: cannot my_setwd innodb_data_home_dir=/rdsdbdata/db/innodb
The data home directory was changed to /rdsdbdata/db, even though no luck. Could someone please help.

nanodbc connecting to MSSQL from Linux

I'm getting an "Invalid attribute value" when I try to connect to MSSQL from Linux.
My current /etc/odbcinst.ini file looks as follows:
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1
Trace=yes
TraceFile=/home/mercury/Desktop/tracefile.txt
UsageCount=1
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2
UsageCount=1
My /etc/odbc.ini file looks like follows (information removed):
[TestServer]
Driver = ODBC Driver 17 for SQL Server
Server = $IP, $PORT
Database = $DATABASE
UserName = $Username
Password = $Password
If I run isql, I can connect with this command:
isql -v TestServer $Username $Password
Before I do the connection with nanodbc I print out the connection string that will be used which is:
DRIVER={ODBC Driver 17 for SQL Server};SERVER=$Server,$Port;DATABASE=$Database;Uid=$Username;Pwd=$Password
I then do:
nanodbc::connection(connectionString); which is where I get the
[unixODBC][Driver Manager]Invalid attribute value
error message.
So after a REALLY long time this turned out to be an issue with Ubuntu 16.04.
unixodbc on Ubuntu 16.04 reports its version wrong so when compiling nanodbc it uses the wrong version of unixodbc.
To fix this, recompile nanodbc with this cmake flag on:
For example:
mkdir build
cd build && cmake .. -DNANODBC_ODBC_VERSION=SQL_OV_ODBC3
This fixed the issue for me.
For future reference, this ticket was the answer: https://github.com/lexicalunit/nanodbc/issues/149

Won't create a PostgreSQL database on Unix server

I am trying to deploy my django project to a unix server. When I run the command to create the PostgreSQL database using SSH, I encounter the following error:
$ createdb elections
createdb: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Does the error mean running 'locally' as in the server or my machine?
What is stopping it from connecting to the server?
How do I fix the error?

how to start postgresql server on Ubuntu 12.04

I had just installed a PostgreSQL 9.1 on the Ubuntu 12.04 server (hosted by Amazon EWS).When I tried to launch the psql command, the following error message shows up.
psql: could not connect to server: No such file or directory Is the
server running locally and accepting connections on Unix domain
socket "/var/run/postgresql/.s.PGSQL.5432"?
After searching on the web, I found I have to start the Server before using it. By following this initdb link, I still cannot use the postgresql database. Are there any further work (like configuration) should I do to start the server ?
I tried to start the service : service postgresql start
Another error message shows :
No PostgreSQL clusters exist; see "man pg_createcluster"
I received this message running a new installation of Postgres 9.3 on Ubuntu 11.04. The full message was:
$ sudo /etc/init.d/postgresql start
Error: Cannot stat /var/run/postgresql
* No PostgreSQL clusters exist; see "man pg_createcluster"
Turned out that the /var/run/postgresql directory did not exist, and it is in that directory where it was attempting to create a file with the process ID. I created the directory as root and made the "postgres" user the owner, and I was able to start the server.
Further explanation found here:
http://www.postgresql.org/message-id/21044.1326496507#sss.pgh.pa.us

vmc tunnel cant select a client, says Please disambiguate: mysqldump or mysql?

i am trying to connect to mysql service via vmc tunnel. Everythings is ok until i have to choose a service.
Log:
Starting tunnel to mysql-7624 on port 10000.
1: none
2: mysqldump
3: mysql
Which client would you like to start?: mysql
Please disambiguate: mysqldump or mysql?
Which client would you like to start?: mysql
Please disambiguate: mysqldump or mysql?
Can you please tell me what's wrong?
please just enter the number of the client you wish to start as apposed to the name of the client, i.e 2 for mysqldump or 3 for mysql.