(no subject)
Mar. 9th, 2016 07:32 pmAstonishingly, for the first time ever I am writing CGI scripts for web pages that will be accessible from off-campus. (Catching up on those mid-1990's technical skills...) Of course I am using mysql for all server-side data handling, so each script starts off with:
$dbh = DBI->connect("dbi:mysql:SleepCog:localhost", 'cgi', 'MyFavoritePassword') ||
die "cannot open database: $!";
Um. See the 3rd argument in the call to DBI->connect()? That's the database password for the database user named cgi. This seems wrong, somehow, to have a password hard-coded into scripts, but offhand I'm not seeing other options. What's the right way to do this?
$dbh = DBI->connect("dbi:mysql:SleepCog:localhost", 'cgi', 'MyFavoritePassword') ||
die "cannot open database: $!";
Um. See the 3rd argument in the call to DBI->connect()? That's the database password for the database user named cgi. This seems wrong, somehow, to have a password hard-coded into scripts, but offhand I'm not seeing other options. What's the right way to do this?