There is no need to erase the configuration, but if you insist delete (or better move somewhere else) the directory /usr/local/mysql/var/mysql which is the databse that stores users info etc.
Else you can stop mysqld and then restart it like this:
Code:
/usr/local/mysql/bin/mysqld --skip-grant-tables -u root
This way it will not ask you for a password. Then connect to mysql server:
and either change the password for the mysql root user if you have already assigned one:
Code:
mysql> UPDATE mysql.user SET Password=PASSWORD('NEWPWD') WHERE User='root';
mysql> FLUSH PRIVILEGES;
or set a password for root:
Code:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NEWPWD');
mysql> SET PASSWORD FOR 'root'@'HOST_NAME' = PASSWORD('NEWPWD');
mysql> FLUSH PRIVILEGES;
HOST_NAME is the name of your box.
If you want mysql to be in your PATH you should edit your ~/.bashrc or ~/.profile or whatever file your distro uses and add a line like this:
Code:
export PATH=$PATH:/usr/local/mysql/bin