Connecting to Heroku clearDB mySql - java

I'm dabbling with Heroku and managed to deploy a simple app. I added a ClearDB MySQL database instance that lives here:
mysql://[user]:[password]#us-cdbr-iron-east-04.cleardb.net
I'm trying to connect to it using "dbforge for mysql" but I'm not sure if this is possible. Anyone know if this would be possible? Below shows what the dbforge connection interface looks like as well as the error I get while trying to connect.

In the screenshot you show, the port is 1, which is incorrect. Check your DATABASE_URL to get the correct port or try 3306, which is the default MySQL port.
In addition, you may need to download and configure the SSL certificates.

Related

How can i connect Azure postgres database to pgadmin as im getting time out error

I have created a database in Azure database in postgreSQL but when i try connect through pgadmin it says unable to connect timeout expired(I'm pretty sure admin and password are correct). Is anyone facing this issue? is there an alternative for pgadmin ?
pgadmin works fine against Azure Postgres. A couple things to check:
Make sure you have a firewall exception in Azure for your local IP address.
Use the user#server format for your username
Use server.postgres.database.azure.comas your hostname
Make sure to set SSL Mode to require in the SSL tab
Good luck!
Below settings works for me, you can use below
pgadmin works perfectly against Azure database for Postgres. Here's the link to the docs.
Add your local IP to your firewall in Azure
In the Azure portal, navigate to connection strings to get your db credentials
Use the user#server format for your username
Use server.postgres.database.azure.com as your hostname
Maintenance database should be set to postgres
Ensure that SSL Mode is set to require under the SSL tab
That is what worked for me.
I got the timeout all of a sudden, and only after some time I realized it was the VPN that probably blocked a port or so. Once I disabled VPN it worked again. Just something to keep in mind.

Java, MySql -- connecting from another computer

I created a java program that uses MySql. Now I want to give the app to someone else, and I'm using the URL as: jdbc:mysql://ipAddress:3306/tableName, but it doesn't work, showing the error of connection failure.
What should I do?
It's a troubleshooting stuff, do the following.
Check the Firewall and Port access on MySQL Server computer.
Check the MySQL Service and the DB User is doing good.
Follow the following thread
How to allow remote connection to mysql

How to connect to a oracle remote database from a java application?

I'm trying to make a java application that connects to a database that is not located on my pc. I'm not sure how to do this. If I create my own database with MySQL, where do i need to store the database in order to acces it from other computers. I want to know what do I need in order to do this. I checked the internet and saw a lot of examples using jdbc and connecting to a url with localhost or something like this. Thank you!
Local: the server address will be 'localhost' or '127.0.0.1'
You can install mysql on your computer and connect to it with the computer's ip (generally 192.168.1.??). You can install LAMP or MAMP to have mysql working easily on your network ('put online' option).
Internet: the server adresse is given by your host, replace the 'localhost' or '127.0.0.1' address on the jdbc parameters.

mysql cpanel netbeans remote connection

hello guys i have seen similar threads concerning my question but couldn't solve my problem. i am trying to remotely connect to the mysql database hosted on cpanel through my netbeans. i have added my ip address as a host to be allowed remote access. the cpanel ip address was given as https:197.211.45.2:2087. the username given as 'root' and the password also given. in my netbeans i try connecting to the database using the stated parameters and the database name but it wouldnt just connect. i have also tried using the default mysql port it still wouldnt work. if there is anything wrong i have done please put me aright. thanksthe image.. i have attached a snapshot. thanks
It's seems that MySQL port is not added in server firewall and due to that you are getting this issues. Please add port 3306 in firewall and check again.
Under cPanel there is usually 'Remote MySQL' tool which allows you to enter the IP addresses that are allowed to connect into the host.

How to connect to a remote database with JDBC?

I'm trying to connect to a remote database via JDBC. Here's my connection string:
db=mysql://user:password#blablabla.rds.amazonaws.com/dbname
At a first glance it seems like it should work, but on trying it, I get the error:
Cannot connected to the database, An attempt by a client to checkout a Connection has timed out.
I'm trying to use Play framework (1.2.x) and have described this db connection in the conf file.
Any ideas?
Following on from duffymo, the string you want to use is jdbc:mysql://blablabla.rds.amazonaws.com/dbname?user=user&password=password as documented here
Yes, this is the wrong URL.
You need the MySQL Connector-J JDBC driver JAR in your CLASSPATH.
The URL should look like this:
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html
I would recommend not putting the credentials in the URL. Add them in Java.
If you're getting an error, please post the stack trace. That will help to diagnose what you did wrong.
Can you connect to that database using the MySQL admin tool? Can you ping that server? Can you telnet to that port? If not, Java won't connect, either. Is there a firewall between your client machine and the database server? If yes, then the MySQL port has to be open for you.

Categories