Skip to main content
July 26, 2008
Question

How do I connect ColdFusion Admin to MySQL

  • July 26, 2008
  • 5 replies
  • 8229 views
I have CF8 working now and I can render CF code but I am having trouble getting CF8
on my MacBook Pro to talk to a MySQL database.

In the CF Administrator when I choose a datasource I choose a MySQL datbase name
and select the MySQL driver 4/5 --- then what do I do.

What folder do I put my MySQL database in? What path do I enter?
I am so in the dark on this (because I've never done this in my life).

I'm not worried about the cfquerey code what is frustarting is how do I
connect CF Administrator Datasource selector to a MySQL database.

It seems like it should be so simple.

1. I am new to MySQL so I don't even know where the database I create in MySQL is.
I type in pwd and that doesn't work in MySQL.

2. Is there a web page that shows the process of selecting a database in MySQL and connecting
to it through the CF Administrator. I get weird error messages when I try to submit a MySQL
database.

Blake
This topic has been closed for replies.

5 replies

Inspiring
August 5, 2008
Hi,

Open a command prompt window and change your directory to c:\mysql\bin (or where you actually installed it).

Then execute the following command,
mysql -h 127.0.0.1 -u root -p

After that set the required privileges for root user by entering following command on mySQL command line:

mysql> grant all privileges on *.* to root@127.0.0.1 identified by 'password' with grant option;.

(Note the password must be surrounded by single quotes).

HTH.
Participant
August 4, 2008
hi,
where r u gettg this err "Connection verification failed for data source"? were u able to create datasource in cf adminstrator? if u r not able to create a datasource pls chk this link and follow the steps.
http://kb.adobe.com/selfservice/viewContent.do?externalId=6ef0253&sliceId=1
i am not sure whthr this helps you. but try.
Inspiring
July 26, 2008
iirc, the default mysql username is root, not admin...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
July 26, 2008
Connection verification failed for data source: myDB
java.sql.SQLException: Access denied for user 'admin'@'localhost' (using password: YES)
The root cause was that: java.sql.SQLException: Access denied for user 'admin'@'localhost' (using password: YES)
Inspiring
July 26, 2008
have you installed mysql and verified it is running?

mysql is NOT a file-based db - there is no FILE to put in any FOLDER.
mysql is a DB SERVER - it runs on a certain server on a particular PORT
(default is localhost:3306), under a username and password combination
you set up. once you have mysql installed, this is all you need to tell
cf to connect to a mysql db: server and port, username and password.

make sure you set up users and grant them only basic permissions
(select, insert, update and possibly delete) for your db's in myslq and
then use those users' credentials for the cf dsn setup - do not use the
ROOT user with all privileges for your cf DSNs.

in light of recent cf-targeted sql injection attacks i will advise you
to run mysql in NO_BACKSLASH_ESCAPES mode.

mysql.com has very good online and downloadable docs.

hth


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
July 26, 2008
Yep. MySQL is working and installed.

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.0.51b MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

July 26, 2008
I have the three Blue Ben Forta Books on CF8 and the yellow MySQL book by Ben Forta
but I don't see any examples of connecting CF8 through the CF Administrator to MySQL.
I get an error message when I try connecting it.