Lompat ke konten
A alfach.com

How to find out the mysql root password

A alfach.com
1 menit baca

One thing that tripped me up on a new install of MySQL and wondering why I couldn't get the default password to work and why even the reset methods where not working. Well turns out that on Ubuntu 18 the most recent version of MySQL server does not use password auth at all for the root user by default. So this means it doesn't matter what you set it to, it won't let you use it. It's expecting you to login from a privileged socket.

SQL
mysql -u root -p

This will not work, even if you are using the correct password.

Instead, you need to use:

SQL
sudo mysql

that will work with out any password. then once you in you need type in

SQL
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Password you want to use';

Bacaan terkait

Komentar (0)

Belum ada komentar. Jadilah yang pertama.

Tulis komentar

Komentar akan dimoderasi sebelum tampil.

Tidak akan dipublikasikan.