MySQL – reimpostare la password di root
Se hai dimenticato la password dell'utente root o di un altro utente del database, questo è un modo molto semplice per ripristinarla. Eseguiamo tutti i comandi dall'account root del sistema operativo.
Innanzitutto, spegniamo il server MySQL:
1 | /etc/init.d/mysql stop |
Avviamo il server di database in background con il comando:
1 | mysqld_safe --skip-grant-tables --skip-networking & |
Accediamo all'account root del database mysql senza inserire una password:
1 | mysql -uroot mysql |
Quindi nella console mysql:
1 2 3 | mysql> update user set Password=PASSWORD('nasze_nowe_hasło') WHERE User='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 |
1 2 | mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) |
1 2 | mysql> quit; Bye |
Riprendiamo il processo dallo sfondo con il comando fg e dopo che appare il messaggio:
1 | mysqld_safe --skip-grant-tables --skip-networking |
useremo la combinazione CTRL + C, dovrebbe apparire:
1 | ^C130504 21:32:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended |
Avviamo il server MySQL in modalità normale:
1 | /etc/init.d/mysql start |
Infine, puoi controllare la password di ripristino:
1 | mysql -uroot -p |
voci correlate:
Installazione corniola e virtualizzazione Debian OpenVZ 7
dl.winehq.org/wine-builds/ubuntu/ focal main' 7.12 dl.winehq.org/wine-builds/ubuntu/ focal main' 22.04
Installazione di RockyLinux Composer 8
Cambiare il nome dell'interfaccia su enp3s0 eth0 in debian 9
ack -l NOME_DB
wp-config.php
wp-admin/setup-config.php
wp-config-sample.php
wp-content/plugins/litespeed-cache/src/db-optm.cls.php
wp-content/plugins/newsletter/system/status.php
wp-includes/load.php
wp-include/ms-load.php





