Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 20, 2019 3:01 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject:
PostPosted: Wed Jan 16, 2002 2:50 pm 
Offline

Joined: Tue Jan 15, 2002 7:00 pm
Posts: 1
Since I restrict my database accesses to localhost, I leave off the passwords. This creates a problem with scripts/sql.php...

$sql = `mysqladmin -u $database_username -p$database_password status | awk '{print $6 }'`;

If $database_password is empty, then this command line asks mysql to prompt for a password, which causes the script to fail to run, since mysql sits and waits for input.

The solution I used is this:

if( $database_password )
{
$sql = `mysqladmin -u $database_username -p$database_password status | awk '{print $6 }'`;
}
else
{
$sql = `mysqladmin -u $database_username status | awk '{print $6 }'`;
}

Aaron

<font size=-1>[ This Message was edited by: sodabrew on 2002-01-16 14:51 ]</font>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2002 3:18 pm 
Offline
Lead Developer

Joined: Sat Oct 13, 2001 7:00 pm
Posts: 2237
Location: Carlisle, PA
Thanks for the notification. I updated sql.php with your change.

-Ian


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group