Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th October 2007, 16:51
yupinho yupinho is offline
Junior Member
 
Join Date: Oct 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default postfixadmin database access error

Hi all!

I'm trying to set up postfixadmin to manage the mailboxes but I get an error when I try to create a new domain. The error is "The domain already exists!" even if the database is empty.
I went to the logs and I found apache user trying to access the postfixadmin database which is not supposed to happen.

[Wed Oct 10 15:40:41 2007] [error] [client 192.168.2.122] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'apache'@'localhost' (using password: NO) in /var/www/html/postfixadmin/functions.inc.php on line 131, referer: http://192.168.2.253/postfixadmin/ad...ate-domain.php
[Wed Oct 10 15:40:41 2007] [error] [client 192.168.2.122] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /var/www/html/postfixadmin/functions.inc.php on line 131, referer: http://192.168.2.253/postfixadmin/ad...ate-domain.php

This happens using mysql database_type in config.inc.php and if I use mysqli the logs change to:

[Wed Oct 10 15:49:15 2007] [error] [client 192.168.2.122] PHP Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /var/www/html/postfixadmin/functions.inc.php on line 132, referer: http://192.168.2.253/postfixadmin/ad...ate-domain.php

I tried to uninstall postfixadmin and then reinstall it and still the same.

Any hints?
Reply With Quote
Sponsored Links
  #2  
Old 11th October 2007, 17:31
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,727 Times in 2,565 Posts
Default

Did you set the correct database user in config.inc.php?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 11th October 2007, 17:43
yupinho yupinho is offline
Junior Member
 
Join Date: Oct 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes, as the machine is still just for testing I didn't even changed the defaults.
And I find it weird that in the logs the user trying to connect the database is apache...

// Database Config
// mysql = MySQL 3.23 and 4.0
// mysqli = MySQL 4.1
// pgsql = PostgreSQL
$CONF['database_type'] = 'mysql';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'postfixadmin';
$CONF['database_password'] = 'postfixadmin';
$CONF['database_name'] = 'postfix';
$CONF['database_prefix'] = '';
Reply With Quote
  #4  
Old 17th October 2007, 23:41
edufl13 edufl13 is offline
Junior Member
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default can´t login

Hi,

I think i got the same error:

Quote:
Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /var/www/virtual/..../htdocs/postfixadmin/functions.inc.php on line 132
Using php 5.3.2 and 5.0.45-Debian_1

There must be an error or use of outdated functions in the mysql connection strings.
On my System neither mysql nor mysqli work

Last edited by edufl13; 17th October 2007 at 23:44.
Reply With Quote
  #5  
Old 20th October 2007, 16:15
riicoo riicoo is offline
Junior Member
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up same problem here

I have this same problem as yupinho described.

My setting is a little different though.
My mail server Postfix and database server MySQL runs on a Debian 4
My Webserver is Slackware 12.0 with PHP 5.2.3, Apache 2.2.4, and Postfixadmin (newest version as of Oct 2007)
Connecting to mysql server from the webserver with user postfix or postfixadmin with no problem after changing the
bind_address=127.0.0.1
to
bind_address=192.168.0.2 #lan ip of the mysql server
in /etc/mysql/my.cnf

Setting of config.inc.php in postfixadmin is as follow:
=======================================
// Database Config
// mysql = MySQL 3.23 and 4.0
// mysqli = MySQL 4.1
// pgsql = PostgreSQL
$CONF['database_type'] = 'mysql';
$CONF['database_host'] = '192.168.0.2'; //ip of the mysql server
$CONF['database_user'] = 'postfixadmin';
$CONF['database_password'] = 'secret';
$CONF['database_name'] = 'postfix';
$CONF['database_prefix'] = '';
=======================================

I believe this is due to platform problem because I just had postfixadmin set up and run with no problem on a SuSE 10.2 system.
Reply With Quote
  #6  
Old 3rd April 2008, 02:32
asyadiqin asyadiqin is offline
Senior Member
 
Join Date: Jul 2006
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
 
Default Possible Fix For This Error

I assumed you had magic_quotes turn off, which is why you are getting this error. I had similar error and found that the problem is that function is not connecting to the database before running the SQL command.

To fix this, refer to this post :-
http://www.howtoforge.com/forums/showthread.php?t=21930
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
64-bit Debian 3.1 Install Issue naruto Installation/Configuration 14 5th September 2006 04:12
configuring IPTABLES firewall adityavpratap HOWTO-Related Questions 9 27th May 2006 21:42
Frustrated with ISPConfig install! woozyerdaddee Installation/Configuration 4 19th May 2006 03:38
Installation Fails... :( cyberstorm Installation/Configuration 1 15th January 2006 18:07
Install stop at uuwish, UUDeview SeaWolf Installation/Configuration 6 4th October 2005 23:53


All times are GMT +2. The time now is 14:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.