How To Reset MySQL Or MariaDB Root Password: Unterschied zwischen den Versionen

Aus Thoms Wiki
Zur Navigation springenZur Suche springen
all>Verkehrsminister
Die Seite wurde neu angelegt: „taken from https://www.ostechnix.com/how-to-reset-mysql-or-mariadb-root-password/ DB stoppen <pre> systemctl stop mysql oder systemctl stop mariadb oder a…“
 
K 3 Versionen importiert
 
(2 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 28: Zeile 28:
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
exit
exit
</pre>
<b>WICHTIG FÜR MARIADB:</b> (https://kofler.info/root-login-problem-mit-mariadb/), weil als plugin hier immer nur "unix_socket" drinsteht.
<pre>
update mysql.user set plugin='' where user='root';
flush privileges;
</pre>
</pre>


Zeile 49: Zeile 56:
mysql -u root -p
mysql -u root -p
</pre>
</pre>
[[Kategorie:Datenbank]]

Aktuelle Version vom 18. April 2020, 13:55 Uhr

taken from https://www.ostechnix.com/how-to-reset-mysql-or-mariadb-root-password/

DB stoppen

systemctl stop mysql
  oder
systemctl stop mariadb
  oder auch
/etc/init.d/mysql stop

Next, restart the database server without permission checking using the following command:

mysqld_safe --skip-grant-tables &

Login

mysql

At the mysql> or MariaDB [(none)]> prompt, run the following command to reset the root user password:

UPDATE mysql.user SET Password=PASSWORD('NEW-PASSWORD') WHERE User='root';
FLUSH PRIVILEGES;
exit

WICHTIG FÜR MARIADB: (https://kofler.info/root-login-problem-mit-mariadb/), weil als plugin hier immer nur "unix_socket" drinsteht.

update mysql.user set plugin='' where user='root';
flush privileges;

Finally, shutdown the running database server that you started earlier with --skip-grant-tablesoption. To do so, run:

mysqladmin -u root -p shutdown

DB wieder starten

systemctl start mysql
  oder
systemctl start mariadb

Verify if the password has really been changed using the following command:

mysql -u root -p