From charlesreid1

Admin

The stock Ubuntu version of MySQL is running on port 3306.

The binary is /usr/bin/mysql.

The configuration is in /etc/mysql/my.cnf.

The database data itself is stored in /var/lib/mysql.

Resetting Password

More info here: https://help.ubuntu.com/community/MysqlPasswordReset

To reset the admin password, first stop the mysql service:

sudo service mysql stop

Next, start mysql with the skip-grant-tables option so that it doesn't worry about authenticating users:

sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

Now start mysql as the root user:

mysql -u root

Now execute the following commands in MySQL, one line at a time:

FLUSH PRIVILEGES;
SET PASSWORD FOR root@'localhost' = PASSWORD('password');

(alt? UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root'; - in case you have root account that can connect from anywhere)

FLUSH PRIVILEGES;

Now you can type "exit" and get back to a regular command line.

Stop and start the MySQL service:

sudo service mysql stop # <-- not really necessary
sudo service mysql start