Languages
[Edit]
EN

MySQL - set root password

2 points
Created by:
Root-ssh
175500

In this short article we would like to show how to set root password in MySQL.

Requirements: root password is not set yet - we have freshly installed MySQL Server.

Simple steps:

  1. Login to MySQL console with:
    sudo mysql
  2. Pass to MySQL consolle following queries:
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-root-password';
    Where: new-root-password should be replaced with desired password.
    FLUSH PRIVILEGES;

Note: above solution were tested with MySQL 8.0.22 under Ubuntu 20.04.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

MySQL - Problems

MySQL - set root password
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join