SAS connect to SQL Server dsn less - sas

I am trying to setup a DSN less connection to SQL Server on a SAS unix machine following this example:
http://support.sas.com/kb/52/777.html
libname mylib odbc noprompt="driver=SQL Server Native Client 10.0;
server=server-name;
uid=user-ID;
pwd=password;
database=SQL-database"
schema=schema-name;
But I got:
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] ODBCINST.INI is not available in the directory pointed to by the ODBCINST environment variable (or the current user's HOME directory) and therefore DSN-Less connections cannot be made.

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.

Connecting to Could SQL from local machine via proxy

I am following these instructions to deploy a Django app on Google App Engine:
https://cloud.google.com/python/django/appengine
I have got as far as downloading the proxy .exe file (I am on a Windows machine) and connecting to it:
2019/01/08 16:14:08 Listening on 127.0.0.1:3306 for
[INSTANCE-NAME] 2019/01/08 16:14:08
Ready for new connections
When I try and create the Django migrations by running python manage.py createmigrations I see the connection received by the proxy file:
2019/01/08 16:15:06 New connection for
"[INSTANCE-NAME]"
However, after a couple of seconds pause I get this error:
2019/01/08 16:15:28 couldn't connect to
"[INSTANCE-NAME]": dial tcp
35.205.185.133:3307: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I have tried disabling my local firewall in case this was causing any issues, but the result is the same. I've also checked the username, password and Cloud SQL instance name, they are all correct.
What could be causing this error?

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?

Connection refused to mysql database from C++ driver

Problem
I'm following tutorial on Connect/C++ provided by dev.mysql. After copying the example and successfully compiling and linking it, I run into following issue:
terminate called after throwing an instance of 'sql::SQLException'
what(): Can't connect to MySQL server on '127.0.0.1' (111)
From what I know 111 stands for Permission Denied.
Setup
Here is the example code taken from here and slightly modified:
#include <mysql_driver.h>
int main()
{
auto driver = sql::mysql::get_mysql_driver_instance();
auto con = driver->connect("tcp://127.0.0.1:0", "root", "123");
delete con;
}
Trying with tcp://127.0.0.1:3306 give the same result.
Here is the CMakeLists.txt:
cmake_minimum_required(VERSION 3.9)
project(mysql_try)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp)
add_executable(mysql_try ${SOURCE_FILES})
target_include_directories(mysql_try PUBLIC /usr/local/include/mysql++)
target_link_libraries(mysql_try mysqlclient /usr/local/lib/libmysqlcppconn-static.a pthread dl)
I can easily run mysql with the credentials in the code. I disabled networking, so that it would only listen on localhost. Running
mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
gave me 0, so I guess it is port 0.
C Connector and command line interfaces work just fine.
My OS is ubuntu 16.04.
I disabled networking, so that it would only listen on localhost.
There's a difference between disabling networking all together (tcp) and specifying tcp to listen ONLY on your loopback adapter (127.0.0.1). Your mysql client is almost certainly connecting via Unix Socket, not TCP, which is why that works fine. Verify that by running mysql --protocol tcp. If that fails, then you know you disabled TCP connections all together, and it's connecting via Unix Socket.
connect("tcp://127.0.0.1:0"
If you did disable networking with skip-networking you need to change your connect() to reference your socket file instead. See the docs
unix://path_name
This URL format enables use of Unix domain socket files for connections to the local host on Unix and Unix-like systems. The path_name value is the socket file path name, just as for the --socket option of MySQL clients such as mysql and mysqladmin running on Unix (see Connecting to the MySQL Server).
Find your socket with:
mysql> SHOW GLOBAL VARIABLES LIKE 'socket'
If you want to keep your connect string the same, remove skip-networking and instead add
bind-address = 127.0.0.1
That should fix it!

Couldn't make connection to MySQL after SQL_MODE is set

I am using wampserver 2.5, I have to change some configuration of my.ini
I added these lines in my.ini file.
[mysqld]
SQL_MODE = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
After adding these lines and restarting my wamp, I could not make connection with MySQL and the color of wamp icon is also orange.
Error:
MySQL said: Documentation
#2002 - No connection could be made because the target machine actively refused it.
The server is not responding (or the local server's socket is not correctly configured).