0

I dont know why I am unable to reset mysql root password.

I follow https://linuxhint.com/change-mysql-password-ubuntu-22-04/ , but still unable to login when I reach Step 7.

Basically, I am unable to login even after stopping mysql, skipping networking & grant tables , & restarting mysql.

I installed a new mysql, apache & php .

mysql version is 8.0.33

When doing :

$ sudo systemctl stop mysql.service
$ sudo systemctl set-environment MYSQLD_OPTS="--skip-networking --skip-grant-tables"
$ sudo systemctl start mysql.service

then, with

$ sudo mysql -u root

I get

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Can someone help, or point me in the right direction ?

By googling, I get the same results. I dont know where or what I am missing.

maan81
  • 3,469
  • 8
  • 36
  • 53
  • You are not asking for MySQL to prompt you for a password. Try `sudo mysql -p`. If you are sudo'ing, then you should not require `-u root`, since you should already be `root`. – Bib Jul 30 '23 at 13:26
  • @Bib I do not know the mysql root's password so I need to reset it. The main cause for me trying to reset mysql's root password. – maan81 Jul 30 '23 at 13:29

0 Answers0