Score:1

Access denied with MySQL root password

ao flag

I installed MySQL on Ubuntu 22.04 and made a mistake.

When I do su - mysql -u root or su - mysql -u root I get Access denied for user 'root'@'localhost' How can I get this to work again?

[1]+  Stopped                 mysql
root@ubuntu-instance1:~# sudo mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 16 Server version: 8.0.31-0ubuntu0.22.04.1 (Ubuntu)

mysql>
update user set plugin='' where User='root';
flush privileges;

Database changed
mysql> 
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0**
in flag
Apologies, I don't understand what the pasted output has to do with the question. Have you broken your `root` MySQL account? If so, you will need to use the administration account that should have been created after installing MySQL. If you did not create an admin account and only used `root`, then you may have hosed that account, meaning only a re-installation of MySQL will resolve the issue
Cagri avatar
cn flag
try this https://stackoverflow.com/a/1709138/13305177 (safe mode and skip-grant-tables), but if you don't have any data, just deleting everything and installing again will be easier
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.