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

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.

Related

pentaho data integration - cant connect to mysql

anyone can help me to resolve my problem?
i can't connect from pentaho to mysql
Error connecting to database [mysql - simpeg] :org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
i already add at \pdi-ce-8.2.0.0-342 PENTAHO\data-integration\lib
com.mysql.jdbc_5.1.5.jar
and i restart my PDI, when i try again, the problem is same.
please help me. Thanks
Pentaho Data Integration uses mysql-connector-java-5.x.xx-bin.jar to connect MySQL for example mysql-connector-java-5.1.49-bin.jar and you can download MySQL driver from here also you can find PDI's JDBC Drivers Reference from here

Connecting Pentaho to mysql database (localhost)

I download last version of MySQL jdbc connector (mysql-connector-java-8.0.13) and I put it in the following folders:
C:\Users\maria\Desktop\report-designer\report-designer\lib
and
C:\Users\maria\Desktop\report-designer\report-designer\lib\jdbc
And it shows me the following error:
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
While, when I introduced the old version file (mysql-connector-java-5.1.34-bin) at the same folders as said before (above). Pentaho shows me the following error:
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
Could not create connection to database server.
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
can someone help me?
Thank you!
Finally I manage to solve the error.
I put my jdbc connector (mysql-connector-java-8.0.13) into the following folder:
C:\Users\maria\Desktop\report-designer\report-designer\lib an
And I change the name of my MySQL DB.
Thank you
Stop Report Designer
Remove it from the 'C:\Users\maria\Desktop\report-designer\report-designer\lib\jdbc' directory
Restart Report designer
You can only have one jdbc driver in the lib directory for the db. So when you add the 5.1.34 driver, you are adding a second MySQL driver, causing that second error.

Cannot connect to Remote SQL DB with Dreamfactory

I am attempting to connect to a remote MySQL database using DreamFactory app.
This is what I am doing:
http://i.imgur.com/S9WHZ5i.png
And this is the error I see in the Dreamfactory app log:
[2014-06-14 09:47:53] app.ERROR: REST Exception #500 > Failed to
launch service "myservice": CDbConnection failed to open the DB
connection.
{"host":"myaddress","request_uri":"/rest/myapp","source_ip":"...","sapi_name":"apache2handler"}
[] [2014-06-14 09:47:53] app.ERROR: SQLSTATE[HY000] [2003] Can't
connect to MySQL server on '...' (111) [] []
I checked on my MySQL machine for any access attempts and I see none.
I think I configured something wrong in the Dreamfactory Admin screens.
Please help!
Many thanks!
User has answered his own question. Had to enable incoming connections within his Amazon EC2 instance. Just a heads up to others having the same issue out there.
Thanks,
Mark

Issue with Azure Emulator and SQLLOCALDB

When in try to start azure storage emulator i get the following error.
Caught exception while probing for SQL endpoint. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Number of Sql Errors Reported: 1 Sql Error: System.Data.SqlClient.SqlError: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
All the Components have been correctly installed .
Kindly Help
Thanx
I managed to fix it by deleting and creating my LocalDb instance. In my case it happened because I installed Azure SDK 2.2 over version 2.1.
The step-by-step to fix it:
Run sqllocaldb i to get your instance name:
C:\Users\myUser>sqllocaldb i
v11.0
Stop LocalDB instance:
C:\Users\myUser>sqllocaldb p v11.0
LocalDB instance "v11.0" stopped.
Delete your LocalDB instance:
C:\Users\myUser>sqllocaldb d v11.0
LocalDB instance "v11.0" deleted.
Create your LocalDB instance with the same name:
C:\Users\myUser>sqllocaldb c v11.0
LocalDB instance "v11.0" created with version 11.0.
Delete database files to allow emulator to recreate db files
C:\Users\myUser\DevelopmentStorageDb22.mdf
C:\Users\myUser\DevelopmentStorageDb22_log.ldf
That should fix your issues.
It looks like your windows account under which you logged in is not sysadmin in sqlexpress instance. Normally emulator uses database within sqlexpress with windows authentication.
The first time you run the Windows Azure storage emulator, an initialization process runs to configure the environment. By default, the initialization process creates a database in SQL Express LocalDB. So, please make sure that your SQLExpress service is running and your login have sufficient rights to use the database within SQLExpress.
If you want to make use of a local instance of an SQL Server to be used by Storage Emulator follow steps listed at http://msdn.microsoft.com/en-us/library/windowsazure/gg433134.aspx.
HTH
Sameer
What i am suspecting is that your LocalDB configuration with emulator is somehow corrupted or misconfigured.
Please follow the blog below to see if you can verify LocalDB instance is ready/working and it is used by Emulator:
http://blogs.msdn.com/b/avkashchauhan/archive/2012/07/10/windows-azure-sdk-1-7-storage-emulator-and-localdb.aspx
If you still have problem the easiest method would be to uninstall SDK 1.7 completely and re-install which will fix any issue with your configuration rather the finding the problem and try to fix which could take longer.
I was getting a similar message:
Probing SQL Instance: 'localhost\SQLExpress'.
Caught exception while probing for SQL endpoint. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Number of SqlErrors Reported: 1
SqlError: System.Data.SqlClient.SqlError: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
No available SQL Instance was found.
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: No available SQL Instance was found.
For me the problem was due to the fact that I was not running with administrator privileges.
Might be a little late to the party here, but I've seen this happen if you clear out or remove items in your "C:\Users[USER_NAME]\AppData\Local\Temp" folder.
At the time of writing this, Azurite is the replacement for "azure storage emulator". In my case, I was able to simply follow the steps here https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=npm#install-azurite to get it installed, and you should be good to go after that.

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.