Kita mungkin tidak mengetahui password root karena bernagai alasan, misal yang melakukan instalasi lupa passwordnya. Di sini kita perlu mengetahui password tersebut.

Untuk mengetahui username dan password MySQL Ubuntu adalah dengan melita file /etc/mysql/debian.cnf.

Contoh penggunaan masuk sebagai user setingkat root dalam keadaan darurat adalah seperti pada contoh di bawah ini

proweb@serverku:/etc/mysql$ pwd
/etc/mysql
proweb@serverku:/etc/mysql$ sudo cat debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = RAHASIADONG
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = RAHASIADONG
socket   = /var/run/mysqld/mysqld.sock

proweb@serverku:/etc/mysql$ mysql -u debian-sys-maint -pRAHASIADONG
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 8.0.35-0ubuntu0.22.04.1 (Ubuntu)

Copyright (c) 2000, 2023, 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>

Informasi lebih lanjut silahkan mengunjungi https://stackoverflow.com/questions/42421585/default-password-of-mysql-in-ubuntu-server-16-04 .

Kunjungi www.proweb.co.id untuk menambah wawasan anda.

Default Password MySQL Ubuntu
× Ada yang dapat saya bantu ? Available on SundayMondayTuesdayWednesdayThursdayFridaySaturday