Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
linux:changerootpwdmysql [07/08/2017 16:39] – créée maxlinux:changerootpwdmysql [09/08/2019 08:24] (Version actuelle) Martin
Ligne 4: Ligne 4:
  
 **  1. Stop mysql:** **  1. Stop mysql:**
-<code>systemctl stop mysqld</code>+<code bash>systemctl stop mysqld</code>
  
 **  2. Set the mySQL environment option**  **  2. Set the mySQL environment option** 
-<code>systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"</code>+<code bash>systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"</code>
  
 **  3. Start mysql usig the options you just set** **  3. Start mysql usig the options you just set**
-<code>systemctl start mysqld</code>+<code bash>systemctl start mysqld</code>
  
 **  4. Login as root** **  4. Login as root**
-<code>mysql -u root</code>+<code bash>mysql -u root</code>
  
 **  5. Update the root user password with these mysql commands** **  5. Update the root user password with these mysql commands**
-<code>mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')+<code bash>mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
     -> WHERE User = 'root' AND Host = 'localhost';     -> WHERE User = 'root' AND Host = 'localhost';
 mysql> FLUSH PRIVILEGES; mysql> FLUSH PRIVILEGES;
Ligne 22: Ligne 22:
  
 **  6. Stop mysql** **  6. Stop mysql**
-<code>systemctl stop mysqld</code>+<code bash>systemctl stop mysqld</code>
  
 **  7. Unset the mySQL envitroment option so it starts normally next time** **  7. Unset the mySQL envitroment option so it starts normally next time**
-<code>systemctl unset-environment MYSQLD_OPTS</code>+<code bash>systemctl unset-environment MYSQLD_OPTS</code>
  
 **  8. Start mysql normally:** **  8. Start mysql normally:**
-<code>systemctl start mysqld</code>+<code bash>systemctl start mysqld</code>
  
 **  9. Try to login using your new password:** **  9. Try to login using your new password:**
-<code>mysql -u root -p</code>+<code bash>mysql -u root -p</code>
  • linux/changerootpwdmysql.1502123975.txt.gz
  • Dernière modification : 08/12/2018 09:21
  • (modification externe)