How to change root password of mysql on debian ?

$sudo mysql
[sudo] password for jeffrin: 
Sorry, try again.
[sudo] password for jeffrin: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.30-1 (Debian)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'unix';
Query OK, 0 rows affected (0.46 sec)

mysql>

Leave a comment

Your email address will not be published. Required fields are marked *