Languages
[Edit]
EN

MySQL - set root password

2 points
Created by:
Root-ssh
93540

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.

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