We help IT Professionals succeed at work.

Server configuration denies access to data source

GeologyETH asked
Dear administrators,

I need to access a MySQL db from ColdFusion web side 7/8. Web and sql server are on different machines. To access the db, I created an user with phpMyAdmin and tested it on the mysql server by "mysql -u _user_name_ -p" which works. The firewall on the sql server is open.

To connect with CF the code as described at http://tutorial421.easycfm.com/ is used.

The connection give the error "Server configuration denies access to data source".

Any idea?
Watch Question

mysql -u _user_name_ -p works only prove it allow  _user_name_ to access the database from local, you need to grant the _user_name_ from the ColdFusion server.

check http://dev.mysql.com/doc/refman/5.1/en/grant.html

You need to do something like

GRANT ALL ON mydb.* TO 'someuser'@'coldfusionhost';


I successfully applied GRANT ALL ON mydb.* TO 'someuser'@'%', but still the same result.
Why are you not using the built in MySQL drivers in CFAdmin? There's drivers for 3 & 4/5

CFAdmin > Data & Services > Datasources > MySQL (4/5)

then just fill out
CF Data Source Name       
Server          Port  

server name can be a netbios name, a dns or an ip


There are reasons not to define a datasource with CFAdmin for this page. But I did it + got an error messages which was useful. The failed connection attempts exceeded the allowed numbers on the sql server. After resetting it with "mysqladmin -u [user] -p flush-hosts" everything worked fine.