Resettare la password root di MySQL su Linux
luglio 14th, 2008 by Giovanni Caputo
Operazioni da seguire passo passo per ripristinare una password persa di MySQL
Per prima cosa: Stoppare processo Server MySQL
# /etc/init.d/mysql stop
Output: Stopping MySQL database server: mysqld.
Avviare il demone MySQL (mysqld) con l’opzione –skip-grant-tables
# mysqld_safe –skip-grant-tables &
Output:
[1] [2345]
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[2222]: started
Connessione al MySQL Server come root
# mysql -u root
Output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Setup nuova password
mysql> use mysql;
mysql> update user set password=PASSWORD(”NUOVA-ROOT-PASSWORD”) where User=’root’;
mysql> flush privileges;
mysql> quit
Uscita e riavvio del Server MySQL
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[1111]: ended
[1]+ Done mysqld_safe –skip-grant-tables
Successivamente possiamo subito provare se le nostre modifiche hanno avuto successo:
# /etc/init.d/mysql start
# mysql -u root -p
Fonte: http://www.3sulblog.com
Post correlati
Questo post è stato postato lunedì, luglio 14th, 2008 at 09:32
nella categoria Open Source, programmi. Tags:linux, mysql, password.
Puoi seguire tutti i commenti di questo articolo attraverso RSS 2.0 feed.
Puoi lasciare un commento, o trackback dal nostro sito.