I have forgotten username and password for MySQL in LAMP stack on Ubuntu. I want to uninstall and reinstall MySQL for the LAMP server.
Asked
Active
Viewed 529 times
1 Answers
1
Create a file (i.e. mysql-reset) containing this line:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');Run MySQL like:
$ mysqld_safe --init-file=/path/to/mysql-reset &
or
$ mysqld -uroot --skip-grant-tables
Simon Sudler
- 4,111
jet
- 7,452