I think it's a matter of user authentification.

First be sure to use 127.0.0.1 for mysql server hostname/ip instead of
localhost.
On some servers using locahost used to fail but this is just a matter if it
is declared in /etc/hosts file as 127.0.0.1.

Second thing is to create a mysql  which has access to the database you want
to connect from CF.

For this, let's take a look at the mysql log file to see what username is
used by cold fusion to auth on mysql.

010125 19:59:08       1 Connect    dancefloor@localhost as anonymous on

We can see in the connect line that the user used on my system is
dancefloor.
This user is the os (linux) user that runs cold fusion server. When you
install CF on linux it asks you for a user to run CF server.
At this time if you specified nobody, or root (not recommended at all), or
any other user, you have to create this mysql user and give him access to
your db.

like this:

[root@www mysql]# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.22.32-log

Type 'help' for help.

mysql> use mysql

mysql> insert into user ('localhost', 'yourUSER',
'','y','y','y','y','y','y','y','y','y','y','y','y','y','y');
mysql> insert into db ('localhost',
'yourDB','yourUSER','y','y','y','y','y','y','y','y','y','y');
mysql>quit

[root@www mysql]# mysqladmin -p reload
Enter password:

After this, try again to connect the db to cold fusion. If it still doesn't
work, try replacing localhost with 127.0.0.1 in mysql.

I hope this helps. I'm not good with english.. my mother tongue is french.

Good Luck!

----- Original Message -----
From: "dennis baldwin" <[EMAIL PROTECTED]>
To: "CF-Linux" <[EMAIL PROTECTED]>
Sent: Thursday, January 25, 2001 9:10 AM
Subject: CF and MySQL


> Can anyone give me some pointers on creating datasources with CF 4.5 on
> Slackware?  They're both running on the same machine and I can connect to
> the MySQL server through command line.  I just can't create a datasource
> through CF Admin.  I keep getting a failed connection when I test the
> datasource.
>
> Thanks,
> Dennis Baldwin
> ZAP Designs
> www.zapdesigns.com
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to