Results 1 to 4 of 4

Thread: Changing root password breaks SugarCRM

  1. #1
    ldinero is offline Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Default Changing root password breaks SugarCRM

    Hello,

    We just installed an open source LMS system (Moodle) on our Windows Server 2008 machine that also hosts our Sugar 5.5.0 application. As part of the install process, it upgraded our MySQL database server to MySQL 5.1.59 Community Edition and changed the 'root' password for MySQL. Moodle works fine both as a web app and directly accessing the database via the MySQL GUI.

    Unfortunately, now we cannot log into Sugar.

    1) We've tried updating the config.php and config_si.php files in the root directory of Sugar to use the new 'root' account password. That gives us this error:

    Unable to select database: Unknown database 'sugarcrm'

    2) If we try to access Sugar using our original 'root' password we get this error:
    Could not connect to server localhost as root.Access denied for user 'root'@'localhost' (using password: YES)

    3) We've tried accessing the sugarCRM database directly with MySQL Workbench but it doesn't see the database at all.

    Does anyone have any suggestions for how we can fix this? Thanks!

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Changing root password breaks SugarCRM

    Maybe the databse really wasn't created or was deleted (somehow). A new installation (setup) could be necessary.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    morrighu is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    34

    Default Re: Changing root password breaks SugarCRM

    First off, it's very naughty to run applications from the database root user. You should always create a user and grant it rights to the database(s) you want it to have access to. To do that...
    Note that you can subsitute your hostname or IP address for 'localhost' if your configuration requires it.

    Code:
    mysql -u root -p
    Get your mysql> prompt
    Code:
    CREATE 'myusername'@'localhost' IDENTIFIED BY 'mypassword';
    CREATE DATABASE 'mysugarcrmdatabase';
    GRANT ALL on 'mysugarcrmdatabase'.*  TO  'myusername'@'localhost';
    FLUSH PRIVILEGES;
    Now to fix your current situation....

    Try logging in from the command line.

    Code:
    mysql -u root -p
    See if either of the root passwords works for you. Failing that there are ways to recover a MYSQL password.

    Stop mysql engine

    Code:
    /etc/init.d/mysql stop
    Become root, Administrator or what ever.

    Restart mysql using a special command from the command line

    Code:
    mysqld_safe --skip-grant-tables &
    Log in to the database from the command line

    Code:
    mysql -u root
    You should get a mysql> prompt

    Code:
    SHOW DATABASES;
    That will list all the databases that are available. If you see sugarcrm listed, you might be ok. If not, I hope you have backups.

    While we're here, lets reset the root password.

    Code:
    USE mysql;
    UPDATE user SET password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    FLUSH PRIVILEGES;
    quit;
    Stop mysql

    Code:
    /etc/init.d/mysql stop
    Start mysql

    Code:
    /etc/init.d/mysql start
    You should be able to log in with your new root password. Now log in (you have to test it anyway) and make yourself a database user.

    Code:
    mysql -u root -p
    Get your mysql> prompt
    Code:
    CREATE 'myusername'@'localhost' IDENTIFIED BY 'mypassword';
    CREATE DATABASE 'mysugarcrmdatabase';
    GRANT ALL on 'mysugarcrmdatabase'.*  TO  'myusername'@'localhost';
    FLUSH PRIVILEGES;
    Give that user name, hostname, and password to the config file. All should be well at that point.

  4. #4
    ldinero is offline Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Default Re: Changing root password breaks SugarCRM

    Many thanks for your help, Morrighu! I very much appreciate you taking the time to spell out the steps we needed to take.

    Quote Originally Posted by morrighu View Post

    Now to fix your current situation....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 2011-06-15, 02:58 AM
  2. MySql root password?
    By Tavares in forum Developer Help
    Replies: 1
    Last Post: 2007-04-23, 05:47 PM
  3. Lost root password and. . .
    By historicslunk in forum Help
    Replies: 5
    Last Post: 2007-01-03, 05:12 PM
  4. root Linux password for 4.2 iso installation
    By mrdebolt in forum General Discussion
    Replies: 0
    Last Post: 2006-05-05, 03:57 AM
  5. Replies: 0
    Last Post: 2005-11-04, 03:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •