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.
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.
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
You should get a mysql> prompt
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.
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.
Bookmarks