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 30th September 2008, 09:29
sergio.arnaldo sergio.arnaldo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default Problems with change_sqlpass

Hi everyone,

I've followed the great Falko's HowTo to install Postfix+Mysql+SMTP-AUT+Quota+Spamassassin... {thank you so much}. I followed it carefully and added some extra from <http://www200.pair.com/mecham/spam/spamfilter20061118.html> and then I installed Squirrelmail webmail and at the end of the day I had a working system.

The problem I am facing for a week now,is that I installed the change_sqlpass plugin but I cannot get it to work. whenever I try to change a user's password I get the following errors:
From mysql log: Connect Access denied for user 'user'@ 'localhost (using password: YES)

From the Squirrelmail window: Error: could not make database connection

I guess these have to be with database connection. This last week I have googled so much to work around this, but I have been unsuccessful.

The error that I get from mysql.log doesn't show the real user that its attempting to change is /her password. It just says 'user'@...

Details of my system are:

Distro: Debian Etch 2.6.18-4-686
MySQL: 5.0.32-Debian-7etch6.log
Squirrelmail: 1.4.8
PEAR: 1.4.11 stable
DB: 1.7.13 stable
Console_Getopt: 1.2 stable
change_sqlpass: 3.3-1.2
compatibility: 1.0

I am really sorry for the long text, but the intention was to be very specific.
I appreciate your help.
NB: I am very newbie with Linux
Reply With Quote
Sponsored Links
  #2  
Old 30th September 2008, 11:17
baldur2630 baldur2630 is offline
Member
 
Join Date: Jan 2007
Location: Belgium
Posts: 30
Thanks: 3
Thanked 1 Time in 1 Post
Default

I don't know change_sqlpass from a box of washing powder, but I do know MySQL

Sounds to me like the users passwords are all restricted to localhost (i.e the box running MySQL. rather than to either a specific address or % (anywhere)

Suggest you go along to the MySQL site and download and install the MySQL GUI tools on the server holding the MySQL databases. Makes life a LOT easier and it's FREE

Then use MySQL Administrator, login as root and make sure that the users passwords are either pointing to a specific address (lots of support hassles) or to % so they can access the system from anywhere
Reply With Quote
  #3  
Old 30th September 2008, 16:41
sergio.arnaldo sergio.arnaldo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default problems with change_sqlpass

Quote:
=baldur2630;147706I don't know change_sqlpass from a box of washing powder, but I do know MySQL
>> .... good enough.... thanks for your reply.

Quote:
Sounds to me like the users passwords are all restricted to localhost (i.e the box running MySQL. rather than to either a specific address or % (anywhere)

Suggest you go along to the MySQL site and download and install the MySQL GUI tools on the server holding the MySQL databases. Makes life a LOT easier and it's FREE
>> Actually I forgot to mention that I have phpMyAdmin installed... does it help?

Quote:
Then use MySQL Administrator, login as root and make sure that the users passwords are either pointing to a specific address (lots of support hassles) or to % so they can access the system from anywhere
>> From phpMyAdmin I have granted privileges to users connecting from % as well as to users connecting from localhost. I thought this would help me, but I didn't go any further. It may be possible that I did not set the privileges in the right manner since I almost know nothing about MySQL. Is there any thing more you could tell me regarding your suggestion to have MySQL GUI tools? Please help!
Reply With Quote
  #4  
Old 30th September 2008, 18:07
baldur2630 baldur2630 is offline
Member
 
Join Date: Jan 2007
Location: Belgium
Posts: 30
Thanks: 3
Thanked 1 Time in 1 Post
Default

I'm sorry, I don't know or use phpMyAdmin. Seems it's one of the first thing the acne-ridden would-be hackers who don't have a life, try to break into, so it's the first thing I get rid of!

You may also have a firewall problem, check if Port 3306 is open. Again, not sure how Ubuntu Firewall works, but if users have % access, it may well be that Port 3306 (or whatever you changed it to if you did), isn't allowing traffic,

If that fails, use something like Wireshark and see where the packets are getting lost. You can obviously connect on the server and other than % and Firewall I can't think of anything else it could be
Reply With Quote
  #5  
Old 30th September 2008, 18:29
sergio.arnaldo sergio.arnaldo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default problems with change_sqlpass

Quote:
Originally Posted by baldur2630 View Post
I'm sorry, I don't know or use phpMyAdmin. Seems it's one of the first thing the acne-ridden would-be hackers who don't have a life, try to break into, so it's the first thing I get rid of!
>> thanks for the quick reply again... I'll surely take that into consideration.

Quote:
You may also have a firewall problem, check if Port 3306 is open. Again, not sure how Ubuntu Firewall works, but if users have % access, it may well be that Port 3306 (or whatever you changed it to if you did), isn't allowing traffic,
>> Actually I have a local firewall on this machine, with iptables, and I gave access to port 3306.
This is my iptables -L output:
Chain INPUT (policy ACCEPT)
target prot opt source destination
FIREWALL 0 -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
FIREWALL 0 -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain FIREWALL (2 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:FIN,SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp dptop3
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- localnet/24 anywhere tcp dpt:ssh flags:FIN,SYN,RST,ACK/SYN
ACCEPT 0 -- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp spt:domain
ACCEPT tcp -- anywhere anywhere tcp spt:domain
ACCEPT udp -- anywhere anywhere udp dpt:ntp
ACCEPT udp -- anywhere anywhere udp spt:6277
ACCEPT udp -- anywhere anywhere udp spt:24441
REJECT tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp reject-with icmp-port-unreachable



Quote:
If that fails, use something like Wireshark and see where the packets are getting lost. You can obviously connect on the server and other than % and Firewall I can't think of anything else it could be
>>Following your suggestion I have just installed Wireshark (I confess this is the first time ever that I hear about this package) and I will see if packets are getting lost during the connection open and where it happens... if I ever manage to use this..

Would you tell me (this may be stupid) how to see the mysql_connect () function? I would like to see how the connection to mysql is made, meaning what is the first argument. Where should I locate it?
Reply With Quote
  #6  
Old 30th September 2008, 19:49
sergio.arnaldo sergio.arnaldo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default problems with change_sqlpass

Well, I couldn't use Wireshark in my machine because I don't have X at all. So I installed it in other machine in the network and It seems Wireshark only analyze packets to and from this machine. I guess it won't be of much help to me now.

But I got some developments. I have been believing that there was this "mysql_connect()" function which would be called to connect to the database. But I as wrong. The change_sqlpass plugin has a file called functions.php which in fact includes among other functions the csp_get_database_connection() that is responsible to make a connection to mysql. Here's the code:
function csp_get_database_connection()
{

global $csp_db_connection, $csp_dsn;


load_config('change_sqlpass', array('config.php'));
csp_get_pear_db();


// make a new connection if needed; exit if failure
//
if (empty($csp_db_connection))
{

$csp_db_connection = DB::connect($csp_dsn);
if (DB::isError($csp_db_connection))
{
global $color;
bindtextdomain('change_sqlpass', SM_PATH . 'locale');
textdomain('change_sqlpass');
$text = _("Could not make database connection");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
plain_error_message($text, $color);
exit;
}
$csp_db_connection->setFetchMode(DB_FETCHMODE_ORDERED);

}


// return connection
//
return $csp_db_connection;

}


When I try to change a user's password I get the "Could not make database connection" in Squirrelmail. And not even that user trying to change his /her password is parsed since the connection is never established.
I don't know if I am still far or near the solution, but I believe that this function may be the key or part of solution.

Please don't give up helping me. I am almost dead with this not working.
<please forget my bad English since I am a Portuguese native speake>
Reply With Quote
  #7  
Old 30th September 2008, 22:50
baldur2630 baldur2630 is offline
Member
 
Join Date: Jan 2007
Location: Belgium
Posts: 30
Thanks: 3
Thanked 1 Time in 1 Post
Default

Yes, I think you are correct, I would love to be able to help you sort it, but I don't know change_sqlpass and my PHP is almost non-existent.

At least we eliminated most of the other possibilities. I'm pretty sure this isn't a MySQL problem and we've eliminated the firewall. so I guess we have to hope that someone on this forum knows PHP better than I and can help you.

If not you could try a PHP Forum or www.linuxquestions.org. You could try to put some debug code into the program (ie. print out the values of all the variables that are being passed by the program).

Hope you get an answer, sorry I couldn't be of more help on this one, but if there is anything else - let me know
Reply With Quote
  #8  
Old 1st October 2008, 13:03
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Quote:
Originally Posted by sergio.arnaldo View Post
Hi everyone,

I've followed the great Falko's HowTo to install Postfix+Mysql+SMTP-AUT+Quota+Spamassassin... {thank you so much}. I followed it carefully and added some extra from <http://www200.pair.com/mecham/spam/spamfilter20061118.html> and then I installed Squirrelmail webmail and at the end of the day I had a working system.

The problem I am facing for a week now,is that I installed the change_sqlpass plugin but I cannot get it to work. whenever I try to change a user's password I get the following errors:
From mysql log: Connect Access denied for user 'user'@ 'localhost (using password: YES)

From the Squirrelmail window: Error: could not make database connection

I guess these have to be with database connection. This last week I have googled so much to work around this, but I have been unsuccessful.

The error that I get from mysql.log doesn't show the real user that its attempting to change is /her password. It just says 'user'@...

Details of my system are:

Distro: Debian Etch 2.6.18-4-686
MySQL: 5.0.32-Debian-7etch6.log
Squirrelmail: 1.4.8
PEAR: 1.4.11 stable
DB: 1.7.13 stable
Console_Getopt: 1.2 stable
change_sqlpass: 3.3-1.2
compatibility: 1.0

I am really sorry for the long text, but the intention was to be very specific.
I appreciate your help.
NB: I am very newbie with Linux
Did you configure config.php as shown on http://www.howtoforge.com/virtual-us...-ubuntu8.04-p5 ? Make sure you use the correct MySQL user and password.
__________________
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
  #9  
Old 1st October 2008, 19:47
sergio.arnaldo sergio.arnaldo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Default problems with change_sqlpass

Falko you're "the man"... you really are!!

Now the change_sqlpass works!!

The problem is that when I configured this plugin I didn't follow the instructions in the link you provided. To be more specific I had the very wrong values to $lookup_password_query, $password_update_queries, $password_encryption, $csp_salt_static, and $scp_salt_query variables.

I changed them accordingly to your suggest and... voila!! The plugin is working fine now.
Thank you very much Falko.
Thank you baldur2630 for your support.
Thank you all that at least read my post.
Reply With Quote
  #10  
Old 13th July 2011, 23:26
spinn_gd spinn_gd is offline
Junior Member
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default ould not make database connection

Hello every one

I did step by step as described in this tutorial, I copied and pasted content into config.php file of change_sqlpass plugin, changed the password (of course) to the database mail in the $csp_dsn section; and when I try to change the password in squirrelmail, I get the ERROR: Could not make database connection . I will be appreciate for help... Thanx
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
Problems with groups/grpconv linuxfast General 28 21st April 2008 09:35
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
Problems with network on debian etch Kap Server Operation 3 29th December 2007 14:29
Empty Recycle Bin jon335 General 40 6th May 2006 11:56
Help! Real newbie having problems installing Linux t-kiss Kernel Questions 5 4th April 2006 15:14


All times are GMT +2. The time now is 23:41.


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