Cannot connect to mysql running of remote machine - java

I am trying to connect to mysql using workbench from my local system.
But, i am getting the below error.
I checked that whether mysql service is running on my remote machine using:
service mysql status;
service mysqld status;
Also, when am trying to connect to mysql programmatically i am getting below error:
java.sql.SQLException: Cannot create connection:Could not connect: Connection refused: connect
and i found that its running . Please correct me here if i am missing anything.

Related

How to connect to MSSQL from Pentaho?

I am trying to connect Pentaho to my local MSSQL server.
I start Microsoft SQL Server Management Studio and I am promted with this window and then just click Connect:
I am using Java 8 Update 261 and Pentaho 7.1. I have downloaded MSSQL JDBC driver from following link:
https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15
and put mssql-jdbc-8.4.1.jre8.jar into pdi-ce-7.1.0.0-12\data-integration\lib folder. Also I have coppied file mssql-jdbc_auth-8.4.1.x64.dll into C:\Program Files\Java\jre1.8.0_261\bin...
Now when I start Pentaho via Spoon.bat file, and try to add MSSQL connection, I get errors, furthermore I have no idea what I am supposed to enter into fields:
HOSTNAME: ?
DATABASE NAME: (name of database is PROFIT)
INSTANCE NAME: ?
PORT: 1433
USERNAME: ?
PASSWORD: ?
From the picture you can see what I have entered. I also checked Use Integrated Security box.
I get following error:
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver)
The TCP/IP connection to the host DESKTOP-CS70NHL, port 1433 has failed. Error: "Socket operation on nonsocket: configureBlocking. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

Unable to connect MySQL using R

I'm learning R language. I want to establish a connection with MySQL using R. I've studied how to do from here, here, tutorial and from many other websites. I've followed all the steps to connect with MySQL, but still I'm unable to connect with MySQL, and getting an error:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on 'localhost' (0)
Here is screenshot of what I did:
I'm using R version-3.2.2 and MySQL version-5.6 and MySQL database is running on localhost:1527. Please help me to remove the error and tell me what I'm doing wrong.
INFO: I'm able to connect above MySQL database with java.
you say that your mysql is running on localhost:1527 - but you don't specify that port in dbConnect, then it probably uses the default port, 3306, so it should not be able to connect... add the port argument to your dbConnect
dbConnect(MySQL(), user="user", password="password", dbname="dbname", host="localhost", port="1527")

Accessing a .mdf SQL Server file using JDBC in Java?

I am trying to access and read data from a .mdf Microsoft SQL Server file (located on a remote server) inside a Java application running locally.
I have a SQL Server JDBC driver installed and it's on my classpath but I still cannot seem to access the file, I get the following error:
The connection to the host PD-SQLTEST, named instance sqlexpress failed.
Error: "java.net.SocketTimeoutException: Receive timed out"
I am defining the connection URL as follows:
String URLSqlServer ="jdbc:sqlserver://PD-SQLTEST\\SQLEXPRESS; databaseName=AOMLive";
The .mdf is called AOMLive.mdf
Any ideas what I am doing wrong here? Does the SQL Server Database on the remote server have to be running for me to access?
You must have the SQL Server running; JDBC cannot read that file directly.

How to connect With CPanel MySql DB from localmachine

I am trying to test the connection from NetBeans IDE8.0 with New Connection Wizard to the Cpanel MySql Database .
I already added my machine ip address in the Remote MySql option of Cpanel but still i am not able to connect with database.
I am getting below error message
Cannot establish a connection to jdbc:mysql:// someIP:3306/hariom?zeroDateTimeBehavior=convertToNull using com.mysql.jdbc.Driver (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
If your server has ConfigServerFirewall installed you need to open the port there as well event though you turned on remote mysql on your cPanel. If you do not own the server you need to contact the host for this.

connecting to postgreSQL server failed

I am trying to install "Kwok information server" and I am new to postgreSQL. I just followed the installation guide of Kwok information server.
when I am trying to install kwok-schema-setup.jar file using java through postgreSQL server in Command Prompt, I am getting the following error..."Connecting to PostgreSQL Server ...failed. Connection refused. Check that the ho
stname and port are correct and that the postmaster is accepting TCP/IP connecti
ons. Cause: java.net.ConnectException: Connection refused: connect
Schema setup encountered errors" .
And when I am trying to connect to the server using pgAdmin III, I am getting the following error "Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? ".
Please anyone help me regarding, Thanks in advance!!
Looks like your Postgresql daemon is not running. Check if the server has started and is running. I dont know which OS you are using but try ps -ax on linux/mac or the task manager in windows.
Maybe a firewall that is blocking the connection, you have to provide more information about your environment to be sure.

Categories