PDA

View Full Version : my.cnf


terrencebrown
10-09-2001, 09:02 PM
Is the password to a mysql db supposed to be stored in the script?

$dbh = DBI->connect("DBI:mysql:database:localhost","USER","PASSWORD");

Isn't there some way to retrieve it from the my.cnf file or some other more secure method?

Dan
10-09-2001, 11:29 PM
you could place a file containing something the info in a dir that cannot be read by the public (outside of public_html or whatever) and include that in your script.

terrencebrown
10-09-2001, 11:32 PM
Sounds good..

And just use a direct path to the file?

Dan
10-09-2001, 11:34 PM
Right. In PHP, it'd be somethign like:

<?php
include("/sqlvars.inc");
?>

terrencebrown
10-09-2001, 11:38 PM
I new it was something like that. There probably is some big admin.cnf just out of reach Reuben uses for our accounts.

Thanks for the help!

I'm trying to get used to being the user.

Dan
10-09-2001, 11:43 PM
Yes, he's scheming against our databases. :)

you're very welcome.

I'm getting used to helping people without being a customer. It's really odd. I don't even know why I'm here. :)

reuben
10-09-2001, 11:50 PM
LOL :D,

This is always a good place to visit even if you aren't a customer :D

Dan
10-10-2001, 12:29 AM
And isn't that the truth!

terrencebrown
10-10-2001, 10:51 AM
Mmmm.