Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Thu Mar 28, 2024 10:57 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
PostPosted: Thu Dec 16, 2010 12:17 am 
Offline
Newbie

Joined: Wed Jan 07, 2009 1:50 am
Posts: 17
Mysql novice! I have installed Open Audit and was trying to setup a a Audit through the web pages - I have all the LDAP settings configured but when I click "Test LDAP" I get the below error message?

DBI connect('database=openaudit;host=localhost;port=3306','openaudit',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at script/audit.pl line 306

I checked the server and could not find a /tmp/mysql.sock but there is one in /var/lib/mysql/mysql.sock so I amended the script in var/www/html/open-audit/scripts/ but it did not make a difference?


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 16, 2010 3:13 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
What happens if you comment out the socket setting code?

So comment out all of the following in audit.pl:
[code] if ( not $WINDOWS_SERVER and $host =~ /localhost/i ) {
if ( -e "/var/run/mysqld/mysqld.sock" ) {
$dsn .= ";mysql_socket=/var/run/mysqld/mysqld.sock";
}
elsif ( -e "/tmp/mysql.sock" ) {
$dsn .= ";mysql_socket=/tmp/mysql.sock";
}
}[/code]


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 17, 2010 8:06 pm 
Offline
Newbie

Joined: Wed Jan 07, 2009 1:50 am
Posts: 17
I tried this but the strange thing is I still get the error so it appears that its not running the script in var/www/html/open-audit/scripts/ but another one from somewhere else which is confusing me!

I rebooted after the changes just incase but this made no difference?


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 18, 2010 2:58 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Have you tried a test connect using the MySQL client? Maybe your MySQL config is not correct. I would check your mysql.cnf file and check the socket value in the [client] section.


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 21, 2010 8:19 pm 
Offline
Newbie

Joined: Wed Jan 07, 2009 1:50 am
Posts: 17
Hi

You seem to be correct in your assumption about MySQL config not being correct. I am a linux novice but I cannot find mysql.cnf (used "find / -name mysql.cnf") the mysql directory files are all in /var/lib/mysql but no conf file there. I have webmin installed and can see MYSQL in there OK.

UPDATE: Found it is /etc/my.cnf when checked this and all looks OK.

"socket = /var/lib/mysql/mysql.sock" but openaudit still errors trying to locate '/tmp/mysql.sock'

I assume there is some issue with mysql configuration so will check this out further just dont understand why openaudit is still erroring on /tmp/mysql.sock when the script was updated to point to /var/lib/mysql/mysql.sock


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 22, 2010 2:36 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Maybe the socket location is set in your php config?

To get rid of the socket stuff altogether use 127.0.0.1 rather than localhost. This should use TCPIP rather than sockets.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 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:  
cron
Powered by phpBB® Forum Software © phpBB Group