Will my PHP application work with Heroku's ClearDB MySql resource? - mysql

I am new to both php and Heroku and I have run into a bit of a problem. Currently my application is running fine on my xxamp testing server with mysql however when I try to host it on Heroku, there is no connection to the MySql server.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)' in /app/www/pdo_testdb_connect.php:6 Stack trace: #0 /app/www/pdo_testdb_connect.php(6): PDO->__construct('mysql:host=127....', 'd2398h23d9d82j3', '8dj1292d3') #1 /app/www/all.php(6): testdb_connect() #2 {main} thrown in /app/www/pdo_testdb_connect.php on line 6
Does ClearDB not work with PHP? Any suggestions would be much appreciated as I've sort of hit a brick wall.

Here is the php integration of Cleardb with Heroku:
define ('DB_USER','xxxxxxxxxxxxxxxx');
define ('DB_PASSWORD','yyyyyyyyyyyyyy');
define ('DB_HOST','us-cdbr-east.cleardb.com');
define ('DB_NAME','heroku_zzzzzzzzzzzzzzzzzz');
Take the params by going in Git and typing heroku config.
You will see a CLEARDB_DATABASE_URL
Here is how to decode it:
mysql://xxxxxxxxxxxxxx:yyyyyyyy#us-mm-auto-dca-01.cleardb.com/heroku_zzzzzzzzzzzzzzz
Interestingly enough, in the official documentation they provide only a Ruby example but nothing about php..
http://devcenter.heroku.com/articles/cleardb

heroku config | grep CLEARDB_DATABASE_URL

Related

Laravel 4.2.22 repo cant connect to AWS DB

I've set up a DB on AWS RDS and when testing our current API against it, I get "Can't connect to MYSQL server...". I can connect to the DB via MYSQL workbench and shell. The API is Laravel 4.2.22 (I know it's old) hosted on an on-prem server via Apache. I duplicated the API, hosting it locally via 'php artisan serve' and was successfully able to hit the DB from that test repo. I need the repo to work on it's current version. I'm not quite sure what to test or where to look. Any direction would be much appreciated.
Error log:
stage.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '...rds.amazonaws.com' (13)' in /var/www/sites/stage/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
Stack trace:
#0 /var/www/sites/stage/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=hard...', 'user', 'pass', Array)

Run Keycloak with database contains data

i configured keycloak with mysql database and it worked,
i created a realm, user, role for test and everything was fine,
I stopped keycloak and restarted it with >standalone.bat
and i got this error:
FATAL [org.keycloak.services] (ServerService Thread Pool – 65) Error during startup: java.lang.RuntimeException: Exception invoking method [listUnrunChangeSets] on object [liquibase.Liquibase#f0132b4], using arguments [null,(),false]
ps: if i delete the database and recreate it and run keycloak it will work but run it with database contains data the error above will appear
Please help me to solve this error. Thank you.
Finally, I found the solution
at the beginning i had the newest version of mysql-connector-java it’s 8.0.23
i replaced it with an old version 8.0.21 and boom it worked for me
ps: of course I modified the file module.xml

Gulp 4 task with node-mysql2 module causing server crash on connect

I have a need to run mysql queries within gulp to check certain fields in a table. I currently connect to a development server via ssh tunnel, which is opened via terminal so that my host is set to 'localhost'.
When I execute a connection attempt, the tunnel crashes with:
channel 4: open failed: connect failed: Connection refused
Then the server process crashes with an out of memory error.
We use node-mysql2 and a ssh tunnel to run GraphQL locally for testing, so I can't think of anything in particular in gulp that would cause what is essentially a race condition almost instantaneously from the time that the gulp command is sent.
Gulp Code:
If anyone has any insights I'd be much obliged.
Fix can be found here, thanks to the mysql2 developer for pointing me in the right direction!
More info on fix here:
https://stackoverflow.com/a/30669454/705115

Cannot connect to MySql database from Eclipse : java/sql/SQLException

I have set up a database with MySql.
I want to connect to it from Eclipse.
I followed the same steps as mentioned in this link:
https://www.zkoss.org/wiki/Setup_MySQL_DB_in_Eclipse
So I am using this library for the driver:
mysql-connector-java-5.1.45
whhich I think is correct
The name of my database is "test" and the port used by MySql is 3306.
This is my configuration:
But when I test the connection it's giving me an error message :
"An internal error occurred during: "Ping server job". java/sql/SQLException"
I have looked more in details in the error log and I see error like this:
java.lang.NoClassDefFoundError: java/sql/Connection
I have turned off my firewall just to check, but it does not solve the issue.
Can someone tell me what I should check?
Thanks
I use Java version 1.7.0_80 and Eclipse Mars.2 Release (4.5.2).
I gave up and used MysQL Workbench which meets my needs.

How to reproduce mysql error 2013

I'am using MySQL version 5.5.14-log and we upgraded recently. Now I'am getting 2013 error in MySQL 5.5.14-log version frequently and I'am not able to reproduce the issue manually, from my application (compiled with MySQL version 5.0.41) only it is reproducing.
Anybody help me to how to reproduce this error or resolve this error. Thanks in advance.
got one answer on net, may this will help you.
error-2013-hy000-0130 resolved
Could you change the bind-address=localhost and restart MySQL server? Seems like this issue is related to yours: http://forums.mysql.com/read.php?152,355740,355742#msg-355742
Also this-
If MySQL port is wrong result is MySQL client error 2013 "Lost
connection ...". Note that this error also occurs if port forwarding
is disabled in SSH configuration (the configuration parameter
'AllowTcpForwarding' is set to 'no' in the 'sshd_config' file). It
(here) simply tells that there is no connection from SSH to MySQL for
some reason. But the mySQL client API 'thinks' there was one
connection and that is why is says 'Lost connection ...' and not
'Can’t connect...'. There was one successful connection - but not to
the MySQL server - to the SSH daemon only! But the MySQL client API is
not designed to 'see' the difference!
Refer this.