MySQL Connect Error

Servoy Developer
Version 3.5.7-build 520
Java version 1.5.0_13-119 (Mac OS X)
MySQL Connector J 5.1.6

I am trying to connect to a remote MySQL server to build a CMS interface to a php/MySQL website

The host has allowed access to me and I have successfully connected using Navicat and MySQL Administrator

However, when I try to set up a server in Servoy, it errors on access as follows:

org.apache.commons.dbcp.DbcpException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user ‘majic’@‘212.xx.xx.xx’ to database ‘ace_co_uk_mysql’
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user ‘majic’@‘212.xx.xx.xx’ to database ‘ace_co_uk_mysql’

I have not come across a situation where it would let me in with one app and not Servoy

Anyone have any ideas where I am going wrong ?

Cheers
Harry

Hi Harry,
are you connecting from the same IP address and using the same credentials? Maybe they have configured the access grant for a specific IP.

Hi Nicola,

I am connecting from our office which has a static IP assigned to our router and the access to the remote host is via the user: ‘majic’ using our static IP which is 212.xx.xx.xx

The remote host has granted access from our IP (212.xx.xx.xx) for the user ‘majic’

This connection has worked through Navicat and MySQL Admin and I can view schema and amend structure

I now wanted to access the remote server via Servoy but the same credentials fail with that access error

Cheers
Harry

Weird, can you post the connection string you are using (with password and IP obfuscated obviously) in Servoy and in Navicat or Mysql Admin?
Difficult to say what’s wrong without that.

Hi Nicola,

Weird it most certainly is :shock:

I have attached screenshots of the Navicat Connection Properties and Servoy Server config dialogues but I don’t see anything out of the ordinary

Thanks for looking at this with me - much appreciated

Cheers
Harry

There is a difference afterall, you are not specifying the dbname in Navicat, can you check if the name you use in servoy is correct?
Second idea: it looks strange that a ISP allows you to connect remotely to a MySQL DB in cleartext, are you sure that Navicat is not using SSL?

You might also try the MySQL JDBC driver. You have the one that ships with Servoy selected. Probably won’t cause the connection problems, but the other would be more reliable, I believe.

greg.

Are you using the old driver? It doesn’t ship anymore with servoy so I didn’t take into account that possibility.
To be sure download the latest one from MySQL website, I think the 5.1 family should be the stable one.

Mmmm, second thought: you are on a mac and you have navicat installed and maybe other DB utilities as well. Some of them unfortunately install their own JDBC driver in some system folder and this overrides the driver that you have in your servoy drivers folder. Check your user’s Library folder and the system Library folder (and subfolders) for old jdbc drivers.

Hi Nicola and Greg

I have the latest MySQL driver (5.1.6) and I have tried all MySQL driver variations in the drop down Driver list in Server config dialogue

There do not seem to be any rogue MySQL drivers anywhere on my system

I have had a chat to the host and asked them to recheck the grant options applied to the target database and reset them and flush the changes

I’ll wait for them to respond and let you know the outcome

Of course, if you have a blinding flash of light moment, then feel free to share with me :D

Cheers
Harry

Update on this issue is that I still can’t connect

The host has sent me a screenshot showing that the user and IP access has the ‘Type’ set as database-specific using phpMyAdmin to set the privileges.

Is this enough or does the access Type need to be global ?

Also I have ports 80 & 3306 open amongst others on our firewall. Are there any others that I need to worry about which may have a bearing on this ?

At the moment, I have no other external host to test a connection against.

Does anybody have a temporary remote MySQL host that I could set up a db connection to in order to establish whether the issue lies at my office end or the host end ?

Cheers
Harry

FYI any interested party

I have resolved this connection issue

The issue seems to have come from the underscores which were in the database name which was originally named : ‘blah_co_uk_mysql’

I had the host dump the database and it was reimported as ‘blahmysql’ and I connected at first attempt

Can’t say that I have ever been aware of any limitation like this and I have not explored what potential combinations within the original name did cause this issue but you may want to use this as a heads up should it happen to you.

Any MySQL gurus out there who may be able to shed any light on this then please do

Cheers
Harry