Reset the Root Password of MySQL Server Reimpostare la password di root di MySQL Server

By default, MySQL Server will be installed with root superuser without any password. Per impostazione predefinita, MySQL Server verrà installato con radice di superutente senza alcuna password. You can connect to MySQL server as root without requiring password or by keying in blank password. È possibile connettersi al server MySQL come root senza bisogno di password o di digitare password vuota. However, if you have set the password for root and forget or unable to recall the password, then you will need to reset the root password for MySQL. Tuttavia, se avete impostato la password di root e dimenticare o non sia in grado di ricordare la password, quindi hai bisogno di reimpostare la password di root per MySQL.

MySQL Reference Manual has detail steps on how to reset password for root which are as below: MySQL Reference Manual ha passi dettaglio su come reimpostare la password di root che sono le seguenti:

The procedure under Windows: La procedura di sotto Windows:

  1. Log on to the Windows system where MySQL is running as Administrator. Accedere al sistema di Windows in cui è in esecuzione MySQL come amministratore.
  2. Stop the MySQL server if it is running. Arrestare il server MySQL se è in esecuzione. For a server that is running as a Windows service, go to the Services manager: Per un server che esegue come servizio di Windows, aprire la Gestione Servizi:

    Start Menu -> Control Panel -> Administrative Tools -> Services Menu Start -> Pannello di controllo -> Strumenti di amministrazione -> Servizi

    Then find the MySQL service in the list, and stop it. Quindi trovare il servizio MySQL nella lista, e fermarla.

    If your server is not running as a service, you may need to use the Task Manager to force it to stop. Se il tuo server non è in esecuzione come un servizio, potrebbe essere necessario utilizzare il Task Manager per forza di smettere.

  3. Create a text file and place the following command within it on a single line: Creare un file di testo e inserisci il seguente comando al suo interno su una sola riga:

    SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’); SET password per 'root' @ 'localhost' = password ( 'MyNewPassword');

    Save the file with any name. Salvare il file con un nome qualsiasi. For this example the file will be C:\mysql-init.txt. Per questo esempio il file sarà C: \ mysql-init.txt.

  4. Open a console window to get to the DOS command prompt: Aprire una finestra di console a raggiungere il prompt dei comandi DOS:

    Start Menu -> Run -> cmd Menu Start -> Esegui -> cmd

  5. If MySQL is installed in C:\mysql. Se MySQL è installato in C: \ mysql. If MySQL is installed in another location, adjust the following commands accordingly. Se MySQL è installato in un'altra posizione, regolare i seguenti comandi di conseguenza.

    At the DOS command prompt, execute this command: Al prompt dei comandi DOS, eseguire il comando:

    C:\> C:\mysql\bin\mysqld-nt –init-file=C:\mysql-init.txt C: \> C: \ mysql \ bin \ mysqld-NT-init-file = C: \ mysql-init.txt

    The contents of the file named by the –init-file option are executed at server startup, changing the root password. Il contenuto del file chiamato dal-init-file vengono eseguiti all'avvio del server, modificare la password di root. After the server has started successfully, you should delete C:\mysql-init.txt. Dopo il server ha avviato con successo, si dovrebbero eliminare C: \ mysql-init.txt.

    If you installed MySQL using the MySQL Installation Wizard, you may need to specify a –defaults-file option: Se si è installato utilizzando MySQL MySQL Installazione guidata, potrebbe essere necessario specificare un-defaults-file opzione:

    C:\> “C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe” C: \> "C: \ Program Files \ MySQL \ MySQL Server 5,0 \ bin \ mysqld-NT.EXE"
    –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.0\my.ini” - Defaults-file = "C: \ Program Files \ MySQL \ MySQL Server 5,0 \ my.ini"
    –init-file=C:\mysql-init.txt - Init-file = C: \ mysql-init.txt

    The appropriate –defaults-file setting can be found using the Services Manager: Le opportune-defaults-file di impostazione può essere trovato usando la Gestione Servizi:

    Start Menu -> Control Panel -> Administrative Tools -> Services Menu Start -> Pannello di controllo -> Strumenti di amministrazione -> Servizi

    Find the MySQL service in the list, right-click on it, and choose the Properties option. Trovare il servizio MySQL nell'elenco, fai clic destro su di esso e scegliere Proprietà. The Path to executable field contains the –defaults-file setting. Il Sentiero alla eseguibile campo contiene il-defaults-file. Be sure to supply the –init-file argument with the full system path to the file, regardless of your current working directory Essere sicuri di fornire i-init-file argomento con l'intero sistema percorso del file, indipendentemente dalla vostra directory di lavoro corrente

  6. Stop the MySQL server, then restart it in normal mode again. Arrestare il server MySQL, riavviarlo in modalità normale. If the MySQL server is ran as a service, start it from the Windows Services window. Se il server MySQL è stato eseguito come servizio, iniziare dalla finestra Servizi di Windows. If you start the server manually, use whatever command you normally use. Se si avvia il server manualmente, utilizzare qualunque comando normalmente si usa.
  7. Connect to MySQL server by using the new password. Connettersi al server MySQL utilizzando la nuova password.

For Unix environment, the procedure for resetting the root password is as follows: Per Unix ambiente, la procedura per reimpostare la password di root è la seguente:

  1. Log on to the Unix system as either the Unix root user or as the same user that the mysqld server runs as. Accedere al sistema Unix come sia Unix utente root o come lo stesso utente che l'mysqld server viene eseguito come.
  2. Locate the .pid file that contains the server’s process ID. Individuare il. Pid file che contiene il processo del server ID. The exact location and name of this file depend on your distribution, hostname, and configuration. L'esatta posizione e il nome di questo file dipendono dalla vostra distribuzione, hostname, e la configurazione. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. I percorsi comuni sono / var / lib / mysql /, / var / run / mysqld / e / usr / local / mysql / data /. Generally, the filename has the extension of .pid and begins with either mysqld or the system’s hostname. In generale, il nome del file ha l'estensione. Pid e inizia con una mysqld o il nome host del sistema.

    Stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command: Arrestare il server MySQL tramite l'invio di un normale uccidere (non uccidere -9) per il processo mysqld, utilizzando il percorso di. Pid file nel seguente comando:

    shell> kill `cat /mysql-data-directory/host_name.pid` shell> uccidere `cat / mysql-data-directory/host_name.pid`

    Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command. Nota l'uso di backticks piuttosto che cita avanti con il comando cat; questi provocare l'uscita del gatto di essere sostituito nel comando kill.

  3. Create a text file and place the following command within it on a single line: Creare un file di testo e inserisci il seguente comando al suo interno su una sola riga:

    SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’); SET password per 'root' @ 'localhost' = password ( 'MyNewPassword');

    Save the file with any name. Salvare il file con un nome qualsiasi. For this example the file will be ~/mysql-init. Per questo esempio il file verrà ~ / mysql-init.

  4. Restart the MySQL server with the special –init-file=~/mysql-init option: Riavviare il server MySQL con la speciale-init-file = ~ / mysql-init opzione:

    shell> mysqld_safe –init-file=~/mysql-init & shell> mysqld_safe-init-file = ~ / mysql-init &

    The contents of the init-file are executed at server startup, changing the root password. Il contenuto del file init sono eseguiti all'avvio del server, modificare la password di root. After the server has started successfully you should delete ~/mysql-init. Dopo il server ha avviato con successo devi eliminare ~ / mysql-init.

  5. Connect to MySQL server by using the new password. Connettersi al server MySQL utilizzando la nuova password.

Alternatively, on any platform, mysql client can be used to set the new password, althought it’s less secure way of resetting the password (detailed instruction In alternativa, su qualsiasi piattaforma, mysql client può essere utilizzata per impostare la nuova password, anche se è meno sicuro modo di reimpostazione della password (istruzioni dettagliate here qui ):

  1. Stop mysqld and restart it with the –skip-grant-tables –user=root options (Windows users omit the –user=root portion). Mysqld interrompere e riavviare con il-skip-concessione-tabelle-user = root opzioni (gli utenti di Windows omettere l'utente root = porzione).
  2. Connect to the mysqld server with this command: Connettersi al server mysqld con questo comando:

    shell> mysql -u root shell> mysql-u root

  3. Issue the following statements in the mysql client: Problema seguenti dichiarazioni in mysql client:

    mysql> UPDATE mysql.user SET Password=PASSWORD(’newpwd’) mysql> UPDATE mysql.user SET Password = password ( 'newpwd')
    -> WHERE User=’root’; --> Dove user = 'root';
    mysql> FLUSH PRIVILEGES; mysql> flush privileges;

    Replace ‘newpwd’ with the actual root password that you want to use. Sostituire 'newpwd' con l'attuale password di root che si desidera utilizzare.

  4. You should be able to connect using the new password. Dovreste essere in grado di collegarsi utilizzando la nuova password.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in lingua inglese whenever possible. quando possibile.

Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .



9 Responses to “Reset the Root Password of MySQL Server” 9 risposte a "Reimposta la password di root di MySQL Server"

  1. Change and Reset MySQL root Password » My Digital Life Cambiamento e reimpostare la password di root di MySQL »La mia vita digitale
    June 6th, 2006 18:12 6 giugno 2006 18:12
    1

    [...] Other then the ways specified here to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: [...] [...] Altri poi i modi specificati qui per reimpostare e cambiare la password di root per MySQL banca dati nel caso in cui la password viene dimenticata o smarrita, le seguenti istruzioni spiegano nei dettagli il modo alternativo durante l'ultima parte della guida, dove altri file non deve essere creata: [...]

  2. Mike Scalora Mike SCALORA
    October 8th, 2007 03:47 8 ottobre 2007 03:47
    2

    You should add –verbose –console to the command in step 5. Si dovrebbe aggiungere-verbose-console per il comando nel passaggio 5. I got a error because of a copy and paste issue that include a quote of the wrong type but there’s no error feedback without the –console. Ho ricevuto un errore a causa di un copia e incolla problema che includono una citazione del tipo sbagliato, ma non vi è alcun errore di feedback senza la console. Also, the -console to stop the server with CTRL-C under windows, not sure about linux. Inoltre, la console per arrestare il server con CTRL-C sotto Windows, non è sicuro di Linux.

    -Mike - Mike

  3. Roar Ruggito
    April 23rd, 2008 23:38 23 aprile 2008 23:38
    3

    This isn’t correct. Questo non è corretto. The syntax should be “–init” not “-init”. La sintassi dovrebbe essere "-init" non "-init".

  4. Roar Ruggito
    April 23rd, 2008 23:39 23 aprile 2008 23:39
    4

    Ah and now that I’ve posted I see the problem. Ah e ora che ho postato vedo il problema. This site is disallowing double “-”. Questo sito è doppio rifiutare "-". It’s being escaped or something. E 'in corso o qualcosa di escape.

    Well dear reader, just now that “-init” should have TWO dashes (hyphens), not one. Beh caro lettore, proprio ora che "-init" dovrebbe avere due trattini (trattini), non uno.

  5. Roar Ruggito
    April 23rd, 2008 23:39 23 aprile 2008 23:39
    5

    Gah. “know” not “now”. "Sapere" non "ora". I’m going for coffee now. Io vado per il caffè.

  6. Rob
    April 24th, 2008 10:05 24 aprile 2008 10:05
    6

    Dude, Tipo,

    Didn’t see these comments while reading the article, but I figured out the double-hyphen syntax by trial and error. Non vedere questi commenti durante la lettura della articolo, ma ho dato il doppio trattino sintassi di prove ed errori.
    Anyway you saved my Life by putting this documentation on the Net !! Comunque hai salvato la mia vita di questa documentazione messa in rete! A thousand thanks ! Mille grazie! -Rob Rob -

  7. Dan
    April 25th, 2008 01:37 25 aprile 2008 01:37
    7

    There is a typo on the mysqld startup script. Non vi è un errore di stampa sulla mysqld script di avvio.

    The correct command requires TWO dashes before the parameter setting. Il comando corretto richiede due trattini prima che il parametro di impostazione.

    The correct command is (note TWO dashes before skip-grant-tables): Il comando corretto è (nota DUE trattini prima skip-concessione-tabelle):

    mysqld_safe –skip-grant-tables mysqld_safe-skip-concessione-tabelle

  8. Kamal BAKOUR Kamal BAKOUR
    July 31st, 2008 21:18 31 luglio 2008 21:18
    8

    Procdure to reset root password in MySQL [RedHat & Fedora] Procdure per reimpostare la password di root in MySQL [RedHat e Fedora Core]

    ====================================================== ================================================== ====
    Step-1 Passo-1
    [root@redhat~]#killall mysqld [root @ redhat ~] # killall mysqld
    [root@redhat~]#/usr/libexec/mysqld –skip-grant-tables –user=root & [root @ redhat ~] # / usr / libexec / mysqld-skip-concessione-tabelle-user = root &

    ====================================================== ================================================== ====
    Step-2 (In MySQL) Step-2 (in MySQL)
    [root@redhat~]#mysql [root @ redhat ~] # mysql
    use mysql; use mysql;
    update user set password=password(”newpassowrd”) where user=”root”; aggiornamento utente a configurare una password = password ( "newpassowrd") dove l'utente = "root";
    flush privileges; flush privileges;
    exit; uscita;

    ====================================================== ================================================== ====
    Step-3 Passo-3
    [root@redhat~]#killall mysqld [root @ redhat ~] # killall mysqld
    [root@redhat~]#/etc/init.d/mysqld start [root @ redhat ~] # / etc / init.d / mysqld inizio

    There you go Ci si va :)

  9. Jose
    August 14th, 2008 10:47 14 agosto 2008 10:47
    9

    phpmyadmin phpMyAdmin

Leave a Reply Lasciare una risposta

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> È possibile utilizzare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Iscriviti senza commentare


Custom Search

New Articles Nuovi articoli

Incoming Search Terms for the Article Cerca in arrivo Condizioni per l'articolo

reset mysql password MySQL reimpostare la password - -- mysql forgot password MySQL dimenticato la password - -- mysql forgot root password MySQL dimenticato la password di root - -- MySQL remove root password MySQL rimuovere password di root - -- remove mysql password rimuovere la password MySQL - -- mysql default password MySQL password di default - -- mysql reset password MySQL reimpostare la password - -- mysql reset root password MySQL reimpostare la password di root - -- xampp mysql password XAMPP MySQL password - -- forget mysql password MySQL dimentica la password - -- mysql remove password MySQL rimuovere la password - -- mysql reset root reset di root di MySQL - -- default mysql password MySQL password di default - -- reset password mysql reimpostare la password di MySQL - -- ubuntu mysql root password Ubuntu MySQL password di root - -- xampp default password XAMPP password di default - -- remove mysql root password rimuovere la password di root di MySQL - -- remove password mysql rimuovere la password MySQL - -- lost mysql password windows MySQL perso la password di Windows - -- mysql password reset MySQL reimpostazione password - -- reset xampp password XAMPP reimpostare la password - -- xampp reset password XAMPP reimpostare la password - -- recover mysql password MySQL recuperare la password - -- resetting mysql password MySQL reimpostare la password - -- forgot password mysql dimenticato la password MySQL - -- mysql lost password windows MySQL perso la password di Windows - -- mysql forget password MySQL dimentica la password - -- mysql root password recovery MySQL password di root di recupero - -- xampp forgot password XAMPP dimenticato la password - -- resetting mysql root password reimpostazione della password di root di MySQL - -- mysql password forgot MySQL dimenticato la password - -- xampp reset mysql password XAMPP reimpostare la password di MySQL - -- delete mysql password eliminare la password MySQL - -- reset mysql password windows MySQL reimpostare la password di Windows - -- Recover MySQL root password Windows Recuperare la password di root di MySQL Windows - -- removing mysql password eliminando MySQL password - -- reset mysql root password windows reimpostare la password di root di MySQL Windows - -- how to remove mysql password come rimuovere la password MySQL - -- reset mysql root reset di root di MySQL - -- how to reset MySQL password come reimpostare la password di MySQL - -- forgot mysql root password MySQL dimenticato la password di root - -- remove root password mysql rimuovere la password di root di MySQL - -- mysql forgotten password MySQL password dimenticata - -- find mysql password MySQL trovare la password - -- xampp mysql root password XAMPP MySQL password di root - -- mysql password recovery MySQL il recupero della password - -- mysql recover root password MySQL recuperare la password di root - -- forget password mysql dimenticare la password MySQL - -- mysql password windows MySQL password di Windows - -- xampp mysql default password XAMPP MySQL password di default - -- reset root password mysql reimpostare la password di root di MySQL - -- reset root password mysql windows reimpostare la password di root di MySQL Windows - -- mysql reset root password windows MySQL reimpostare la password di root di Windows - -- mysql password forget MySQL password dimenticate - -- mysql 5 default password MySQL 5 password di default - -- forgot password for mysql Dimenticato la password per MySQL - -- mysql removing root password MySQL eliminare password di root - -- recover mysql password windows MySQL recuperare la password di Windows - -- mysql windows lost password MySQL Windows perso la password - -- windows mysql password Windows MySQL password - -- all tutto - -- forgot xampp password XAMPP dimenticato la password - -- xampp default mysql password XAMPP MySQL password di default - -- mysql 5.0 default password MySQL 5,0 password di default - -- mySQL recover password windows mySQL recuperare la password di Windows - -- reset mysql root password reimpostare la password di root di MySQL - -- recover mysql root password recuperare la password di root di MySQL - -- remove password in mysql rimuovere la password in MySQL - -- xampp password mysql XAMPP password MySQL - -- mysql 5 reset root password MySQL 5 reimpostare la password di root - -- removing mysql root password rimuovere la password di root di MySQL - -- xampp password reset XAMPP la reimpostazione della password - -- removing root password mysql rimuovere la password di root di MySQL - -- reset mysql password xampp MySQL reimpostare la password XAMPP - -- mysql5 default password mysql5 password di default - --