Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Keeping MySQL connection parameters in a safe placeby wfsp (Abbot) |
on Dec 27, 2005 at 15:00 UTC ( [id://519337]=perlmeditation: print w/replies, xml ) | Need Help?? |
Your Mother alerted me to a neat trick for keeping MySQL connection parameters in a safe place by using the mysql_read_default_file connection option. A couple of points to note:
Note there is no connection info in the script at all. It's tucked away nicely in a cnf file. For example:
The DBD::mysql docs give an indication on how to use option files but more can be found on the MySQL site: To see which options are available:
The last link points out that you need the two undef parameters in the connect statement. Version info:
MySQL -> 4.0.17 (remote)
DBI 1.32 (remote)
DBD::MySQL 2.0419 (remote) Hope this is of some use and many thanks to Your Mother for the pointer. John update:
The 'interesting article' linked to above should be credited to gmax (see below).
Back to
Meditations
|
|