Cannot connect to MySQL with 7.0.1

General discussion on Zend Studio

Cannot connect to MySQL with 7.0.1

Postby mauritzbotha on Tue Sep 15, 2009 4:31 am

I am using a Mac with MAMP Pro and with 7.0 my database connection worked just fine.

I upgraded to 7.0.1 and it loaded all my projects, configurations and files, but I get an error message:
Could not connect to MyLocalSQL
Error creating SQL Model Connection connection to MyLocalSQL. (Error: com.mysql.jdbc.Driver)
com.mysql.jdbc.Driver
Error creating JDBC Connection connection to MyLocalSQL. (Error: com.mysql.jdbc.Driver)
com.mysql.jdbc.Driver

I've tried changing the settings for MySql from 3306 to 8889, but no change. The database is up and running and I can connect to it with the user credentials if I run the site on the MAMP installation.
mauritzbotha
 
Posts: 9
Joined: Tue Sep 15, 2009 4:23 am

Re: Cannot connect to MySQL with 7.0.1

Postby ganoro on Tue Sep 15, 2009 6:03 am

Hi,
I couldn't reproduce this problem with my MySQL connection, wondering if you can provide more details.

Roy
User avatar
ganoro
 
Posts: 409
Joined: Wed Jan 21, 2009 5:00 pm

Re: Cannot connect to MySQL with 7.0.1

Postby mauritzbotha on Tue Sep 15, 2009 6:30 am

Hi Roy

I wish I could.

In 7.0 I set up a database connection by going to the Data Source Explorer and creating a new database connection.

I specified the database, username, password and that it is MySQL running on a local host.

I then hit the "Test Connection" button and got confirmation that the connection was fine. I then checked the option that saved the password and that allow the connection to be established every time Zend Studio starts.

This morning I installed 7.0.1 and uninstalled 7.0

On startup I got the error message. I then verified the MySQL, I tried the different versions of the JDBC drivers (4.0, 4.1, 5.0, 5.1), no luck

I tried to set up a new connection, no luck. I changed the user and granted all rights in MySQL, still no luck.

If I run my web pages under MAMP on the same machine, I can connect to the MySQL without any issues, using the exact same user credentials and PHP files.
mauritzbotha
 
Posts: 9
Joined: Tue Sep 15, 2009 4:23 am

Re: Cannot connect to MySQL with 7.0.1

Postby ganoro on Tue Sep 15, 2009 11:10 am

I think I know this problem from the past,
Can you please switch to a new workspace and verify that the connection is valid? I think that the preferences of the last workspace are not relevant to your existing workspace so the connection is lost.

If this is not the case, can you provide the schema of the file so we will be able to reproduce it?

Thanks again for reporting,
Roy
User avatar
ganoro
 
Posts: 409
Joined: Wed Jan 21, 2009 5:00 pm

Re: Cannot connect to MySQL with 7.0.1

Postby mauritzbotha on Tue Sep 15, 2009 7:40 pm

Thanks so much for the help.

Turned out that I installed Zend Server CE and it also installed an instance of MySQL. I created my database in the MAMP instance of MySQL and not in ZS's instance, that is why the connection failed
mauritzbotha
 
Posts: 9
Joined: Tue Sep 15, 2009 4:23 am

Re: Cannot connect to MySQL with 7.0.1

Postby fmoskopp on Mon Oct 05, 2009 9:34 am

Hi mauritzbotha,

I see you use Mac, Zend and MAMP too!

I have the same problem. Zend install on Port 3306 and MAMP on port 8889. With the MySql Administrator I can connect with both preferences.
What have you do to fix the problem.

Also I programming in php an the debugger crash in all sql statement with the error:

Can not connect to database Can't connect to local MySQL server through socket '/usr/local/zend/mysql/tmp/mysql.sock' (2)

Thanks for help,

Frank
fmoskopp
 
Posts: 1
Joined: Mon Oct 05, 2009 9:25 am

Re: Cannot connect to MySQL with 7.0.1

Postby bleak on Mon Oct 05, 2009 4:42 pm

Since there's already a topic about this (and from other Mac users, to boot), I guess I'll hijack it instead of creating a new one :)

My problem is somewhat different, though. I haven't been able to connect to MySQL using ZSfE6 or ZS7. When setting up a new connection, I choose MySQL for the connection profile with the following driver and connection details:

Driver: MySQL JDBC 5.0 Default (I run MySQL 5.0.51b)
Database: myDB
URL: jdbc:mysql://localhost:3306/myDB

And a valid username/password. When testing the connection, I'm always presented with the following error:

Ping failed!

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:592)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:205)
at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:104)
at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:72)
at org.eclipse.datatools.enablement.internal.mysql.connection.JDBCMySQLConnectionFactory.createConnection(JDBCMySQLConnectionFactory.java:28)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:355)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I know MySQL is listening on 3306 because netstat shows:

Code: Select all
tcp4       0      0  *.3306                 *.*                    LISTEN


I've also tried changing the driver, but no luck.

I love ZS, but this is a major source of frustration for me.
bleak
 
Posts: 21
Joined: Sun May 03, 2009 8:27 pm

Re: Cannot connect to MySQL with 7.0.1

Postby bleak on Tue Oct 06, 2009 8:08 am

I solved the problem above. I don't know if it's my installation specifically, a bug within ZS, or just the OSX platform, but it seems that the JDBC driver that comes packaged with ZS is corrupt. I downloaded the MySQL JDBC 5.0.8 driver from mysql.com, unpacked it in ~/Zend/workspaces/DefaultWorkspace2/mysql-connector-java-5.0.8/. I created a new database connection using that driver, instead of the default, and it worked perfectly.
bleak
 
Posts: 21
Joined: Sun May 03, 2009 8:27 pm

Re: Cannot connect to MySQL with 7.0.1

Postby radumas on Wed Jun 09, 2010 8:23 pm

how do I install a new driver?

When I select mysql as my database, it gives a selection of four drivers. If I add one as you describe, it doesn't show up as an option.

---
edit: I figured out how to edit drivers, but alas that doesn't work.
radumas
 
Posts: 4
Joined: Wed May 19, 2010 1:13 am

Re: Cannot connect to MySQL with 7.0.1

Postby kaseit on Thu Oct 28, 2010 1:53 pm

I just downloaded Zend studio 7.
I have just tried to connect to my existing mySQL database and I get this very unhelpful error message:
java.sql.SQLException: Unknown database 'database'
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3647)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2544)
at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:206)
at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:104)
at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:72)
at org.eclipse.datatools.enablement.internal.mysql.connection.JDBCMySQLConnectionFactory.createConnection(JDBCMySQLConnectionFactory.java:28)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:355)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Why can't this product point to the database I setup?
Why is it pointing to Xend's installation?

I downloaded this IDE so I could concentrate on writing code and designing web applications.
Yet I find at every turn, something in the IDE does not work.
Can I delete Zend's mysql installation?
where it is located in Zend setup?

Does downloading another jdbc driver actually work in getting the basic connection to mysql database?

Thanks
kaseit
 
Posts: 1
Joined: Thu Oct 28, 2010 1:43 pm

Next

Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 3 guests