#1  
Old 14th February 2011, 00:06
Nolan Nolan is offline
Member
 
Join Date: Nov 2010
Posts: 83
Thanks: 2
Thanked 6 Times in 4 Posts
Default MySQL Error

Hi, I had to reinstall my OS because of a failed upgrade to Debian 6.

I'm back on Debian 5 again, and I just dragged the contents of my old database folder (/var/lib/mysql) into the new database folder, and I changed the root password back to what it was on the old server. However, I'm getting this error:


Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ispconfig'@'localhost' (using password: YES) in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 72
Here is line 72:
PHP Code:
$this->linkId mysql_connect($this->dbHost$this->dbUser$this->dbPass); 
Here is the information line 72 calls for:
PHP Code:
private $dbHost '';           // hostname of the MySQL server
    
private $dbName '';           // logical database name on that server
    
private $dbUser '';           // database authorized user
    
private $dbPass '';           // user's password
    
private $dbCharset '';       // what charset comes and goes to mysql: utf8 / latin1
    
private $linkId 0;           // last result of mysql_connect()
    
private $queryId 0;           // last result of mysql_query()
    
private $record    = array();       // last record fetched
    
private $autoCommit 1;        // Autocommit Transactions
    
private $currentRow;           // current row number
    
private $errorNumber 0;       // last error number
    
public $errorMessage '';       // last error message
    
private $errorLocation '';   // last error location
    
public $show_error_messages false
I'm not sure if the code is supposed to be ' ' or not, I haven't ever looked on a regular installation.
I tried filling in my database information in those fields but it still didn't work.

Last edited by Nolan; 14th February 2011 at 03:21. Reason: Forgot to provide database info.
Reply With Quote
Sponsored Links
  #2  
Old 14th February 2011, 11:08
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

The code is absolutely ok of course. Please undo all changes that you made to the code.

Back to your original problem, by copying back the databases you have overwritten the password of the ispconfig user. This password has to be corrected in the mysql database and not the ispconfig files. Did you make a backup of the mysql.mysql database which conatins the users on the new system before youve obvewritten the db with the old database? If yes, then take this backup and get the password lines for the ispconfig users from it from all tables that are in the database and add them to the current mysql user database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 14th February 2011, 21:52
Nolan Nolan is offline
Member
 
Join Date: Nov 2010
Posts: 83
Thanks: 2
Thanked 6 Times in 4 Posts
Default

No, I didn't save a copy of the new users. However the only users created on the new installation of ISPconfig was the admin account, nothing else.
I didn't set up any other accounts or begin to add a website on the new installation. All I did was change the admin password on the new installation from the default password of admin
Reply With Quote
  #4  
Old 14th February 2011, 22:19
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

I'am not atlking about ispconfig users, I talk about mysql users. The ispconfig installer creates a mysql database user name ispconfig and I guess that you have overwritten this user by copying back the old mysql database. The problem that this causes now is that neither the ispconfig nor services like postfix, pure-ftpd or dovecot / courier can connect to mysql anymore.

Please open the file /usr/local/ispconfig/server/lib/config.inc.php, in this file you find a mysql password. This is the cleartext password of the mysql user. Copy this password (do not chnage it in that file!), then open the mysql database with the name "mysql", find the user table in that database, there you will find a user named "ispconfig". Change the password for that mysql user to the password that you found in the config.inc.php file. Select "password" as encryption method. And then reload or restart the mysql database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Nolan (14th February 2011)
  #5  
Old 14th February 2011, 22:30
Nolan Nolan is offline
Member
 
Join Date: Nov 2010
Posts: 83
Thanks: 2
Thanked 6 Times in 4 Posts
Default

Hi till, thanks for the response. How would I do this via command line?
Reply With Quote
  #6  
Old 14th February 2011, 22:59
Nolan Nolan is offline
Member
 
Join Date: Nov 2010
Posts: 83
Thanks: 2
Thanked 6 Times in 4 Posts
Default

Never mind!
I got it.

Code:
mysql -u root -p
use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='ispconfig';
flush privileges;
quit
in this case.

It's able to connect now
Reply With Quote
The Following 2 Users Say Thank You to Nolan For This Useful Post:
aangelatexaxda9431 (5th February 2013), AbannyvabVask (25th October 2013)
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
Webmin upgrade lishaw1968 Installation/Configuration 15 26th August 2010 16:23
mod_layout and php gd branov Installation/Configuration 8 2nd September 2009 16:51
Need help setting up domainpop with postfix kameelperdza Installation/Configuration 6 15th June 2009 08:49
dovecot problem sojic Server Operation 21 23rd March 2008 19:22
Apache trouble wont restart Domain coroption main3 Installation/Configuration 1 16th September 2006 13:09


All times are GMT +2. The time now is 15:05.


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