LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-09-2013, 10:43 AM   #1
mwx
Member
 
Registered: Jan 2009
Location: Virginia, USA
Distribution: CentOS - Ubuntu
Posts: 69

Rep: Reputation: 0
Snort - Snort Report - mysql_pconnect() - errors


I am setting up a test installation of SNORT and so far everything is going well.
Snort connects to the DB and is currently logging alerts - thus far - there doesn't seem to be an issue there.

But when I try to connect to the web interface to view the Snort Report (via alerts.php) I am greeted with the following error.

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'snort'@'localhost' (using password: YES) in /var/www/snortreport-1.3.3/DB_mysql.php on line 15

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /var/www/snortreport-1.3.3/DB_mysql.php on line 20
Access denied for user 'snort'@'localhost' (using password: YES)


I've searched the "Land of Google" for some time with no results - so I'm turning here. I'm a little stumped when it comes to MySQL.

Below is the copy of mysql.php. Hopefully I can get a few pointers on where to start looking.

Code:
<?php
	/*
	
	DB Abstraction layer Copyright 2001 Jason Costomiris
	Distributed under the terms of the GPL v2

	*/

	class DB extends DB_base {
		
		// Connect or pconnect.
		function connect(){
			if($this->persist){
				$this->conn = 
					mysql_pconnect($this->instance, $this->user, $this->pass);
			} else {
				$this->conn = 
					mysql_connect($this->instance, $this->user, $this->pass);
			}
			mysql_select_db($this->dbname, $this->conn);
			$str = mysql_error();
			if($str) { die($str); }
			return($this->conn);
		}

		// close
		function close(){
			if($this->persist) {
				$ret = 1;
			} else {
				$ret = mysql_close($this->conn);
			}
			return($ret);
		}

		// query
		function query($query){
			$this->result = mysql_query($query);
			$str = mysql_error();
			if($str) { die($str); }
			return($this->result);
		}
		
		// numrows - modified this function to take input 
		//           so you can do nested queries by passing
		//           returned object from query function
		//           Modified:  6/30/2000 JMc
		function numrows($result){
			$this->numrows = mysql_num_rows($result);
			return($this->numrows);
		}

		// affected rows
		function affrows(){
			$this->affrows = mysql_affected_rows($this->result);
			return($this->affrows);
		}

		// seek
		function seek($result, $row){
			$seek = mysql_data_seek($result, $row);
			return($seek);
		}

		// fetch object - modified this function to take input 
		//                so you can do nested queries by passing
		//                returned object from query function
		//                Modified:  6/29/2000 JMc
		function fobject($result){
			$object = mysql_fetch_object($result);
			return($object);
		}

		// fetch array - modified this function to take input 
		//               so you can do nested queries by passing
		//               returned object from query function
		//               Modified:  7/3/2000 JMc
		function farray($result){
			$array = mysql_fetch_array($result);
			return($array);
		}

		// result
		function result($result, $index){
			$value = mysql_result($result, $index);
			return($value);
		}
		
		// free
		function free($result){
			$free = mysql_free_result($result);
			return($free);
		}

		function timeSinceEpoch($col) {
			return "UNIX_TIMESTAMP($col)";
		}
		
		function timestamp($time) {
			return "FROM_UNIXTIME($time)";
		}
		
		function dateFormat($col, $format) {
			return "DATE_FORMAT($col, \"$format\")";
		}

		function quote($str) {
			return "\"$str\"";
		}

	}

?>
 
Old 02-10-2013, 09:44 AM   #2
mwx
Member
 
Registered: Jan 2009
Location: Virginia, USA
Distribution: CentOS - Ubuntu
Posts: 69

Original Poster
Rep: Reputation: 0
Well - it turns out it's pretty stupid really. I had to launch mysql again and reissue the user password even though I had done it twice before through another application (GUI) on the box. It wasn't until I went in and issued the passwd from the command line that it finally took.
Oh well. Moving on.. Now digging through the rest of the configuration including Barnyard2..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
1-snort Vs ntop-- 2- snort perfstat.exec PoleStar Linux - Newbie 1 09-06-2010 02:52 PM
[HELP]SNORT PROBLEMS(IDS)-service snort start JayCool Linux - Software 5 03-15-2009 01:34 PM
Typographical error in my snort report for FTP IDS. ogoy Linux - Software 5 12-13-2008 08:50 AM
Snort - no portscan and tcp alerts in snort av.dubey Linux - Software 6 07-11-2008 10:56 PM
LXer: Report: Snort: IDS Done Well (and Good) LXer Syndicated Linux News 0 07-02-2007 08:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration