Best way/place to store MySQL password?

Associate
Joined
15 Nov 2002
Posts
816
Ok, just starting to teach myself PHP/MySQL and trying to get into good habits from the off.

Whats the best way of storing the MySQL database password?

All the examples I've been reading have the password stored as plain text which is nice and easy for learning, but I assume not great for security! :P

TIA
 
Do you mean the password you use to connect to the mysql database? And you don't want it to be readable when looking at your scripts code?

Thanks to all that's replied so far :)

Yes and no :P

I do mean the password that you use to connect to the database, but I mean if someone was somehow able to gain access to the script where the database connection is made, they have the password to the entire database.

Is it better to store the script(s) that contain references to the password outside the www root folder or some other method?

Nice link to Coding Horror Sic, I'll have a read through that also.
 
Back
Top Bottom