I'm using the mysql-connector-c++ 8.0 after getting it working with great difficulty and now the uri I've entered is as their mentioning in the docs but the connection is refused.
What the doc says:
Client cli("user:password#host_name/db_name", ClientOption::POOL_MAX_SIZE, 7);
My Code:
_mysql_client = std::make_unique<mysqlx::Client>("mysqlx://root:asdasd#localhost/asdasd");
try {
mysqlx::Session s = _mysql_client->getSession();
CoreLog->info("Successfully connected to mysql server on {}.", conn_uri);
} catch (const mysqlx::Error &err) {
CoreLog->info("Could not connect to mysql server on {} due to {}.", conn_uri, err.what());
}
and i get this error
[20:34:36.993] Core: Could not connect to mysql server on root:asdasd#localhost/asdasd due to CDK Error: Connection refused (generic:61).
What's the issue here?
mysqlx::Client is for connection to the new Mysql X protocol. This listens on a different port (33060 by default instead of 3306) which is the cause of the "connection refused" message.
You need to install and enable the Mysql protocol X plugin. See https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html for instructions.
Related
I'm currently working with my office server, when i want to connect to the server, i have to use their VPN. I have installed PostgreSQL database in their server and have succesfully migrate data to database from Django project. But, when i want to remote access from HeidiSQL, it always gives me Connection Timed Out Error eventhough i have already connected to their VPN.
I've tried to this code below
/var/lib/pgsql/14/data/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::/0 md5
/var/lib/pgsql/14/data/postgresql.conf
listen_addresses = '*'
i have tried to refresh everytime i change files and see if i'm in the correct port but it still gives me Connection Timed Out Error
this is the full error message
could not connect to server: Connection Timed out (0x0000274C/10060). Is the server running on host "xxx.xxx.xxx.xxx" and accepting TCP/IP connections on port 5432 ?
NOTES
OS : CentOS 8
DB : PostgreSQL 14
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?
I've tried to establish a connection by both command line and in my C++ project.
In a "secure" version I received:
OpenSSL error: 336130315:SSL routines:SSL3_GET_RECORD:wrong version number
If I try with an insecure connection, I received:
connection to 'neo4j://localhost:7474' failed: Could not agree on a protocol version
but I successfully access to the db via browser on the same port number.
How could I repair?
An insecure connection is good for me.
I'm using Oracle 11g and Django 1.5.1.
I have installed cx_Oracle, import cx_Oracle works fine.
I setup database settings like this:
DATABASES = {
'default' : {
'ENGINE' : 'django.db.backends.oracle',
'NAME' : 'XE',
'USER' : 'system',
'PASSWORD' : 'mypass',
'HOST' : '127.0.0.1'
'PORT' : '1521'
}
}
When I said
python manage.py syncdb
it said
DatabaseError: ORA-12170: TNS:Connection timeout occurred.
I can connect to database with Navicat.
This error means it was unsuccessful in making a tcp connection to 127.0.0.1 port 1521
As root, or the user running the Oracle database, what address is shown for the LISTENing port in the output of lsof -Pni:1521
If it is not 127.0.0.1:1521 or *:1521, then it won't be listening on 127.0.0.1
However. This is a connection timeout, not something like port unreachable (connection refused)
You didn't say if you were running navicat from the same machine or a different machine. If the above command shows only 127.0.0.1:1521, then it's only listening on that IP address, and would need to be changed to allow connections from other machines, if that is what you are trying to achieve.
Check for firewall rules that may block traffic.
If attempting to connect remotely, doing a network trace can be useful to determine the problem. I recently had an issue similar to this that caused ARP to malfunction. You can see how I diagnosed that particular issue at http://distracted-it.blogspot.co.nz/2014/04/ora-12170-tnsconnect-timeout-resolved.html
i just installed pgadmin iii and try to connect server.
I configured my setting
name:localhost
host: 127.0.0.1
port:5432
username:postgres
but i always get this error
The server doesn't accept connection: the connection library reports
**could not connect to server : Connection refused Is server runing on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
However, i'm runing django and python on 127.0.0.1 What's missing?
There's also a problem with mysql. I could not connect with them
If you change the pg_hba.conf file to accept connections (for example: "host all all 127.0.0.1 255.255.255.0 trust") it should work
Installing postgre v12 before uninstalling v11 I found the config file (postgresql.conf) had a line "port = 5433". Changing this to "port = 5432" fixed the issue for me.