MariaDB root Kennwort nach der Installation ändern

jmar83

SQL-Guru
Beiträge
146
Geht nicht:


Code:
Geht nicht:


[CODE]root@xtest:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 24
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'' at line 1
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'' at line 1
MariaDB [(none)]> SHOW DATABASES
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| phpmyadmin         |
+--------------------+
4 rows in set (0.01 sec)

MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
Query OK, 0 rows affected, 1 warning (0.01 sec)

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> exit
Bye
root@xtest:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 25
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> Ctrl-C -- exit!
Aborted
root@xtest:~# ^C
root@xtest:~#
root@xtest:~#
root@xtest:~# sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 28
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');Ctrl-C -- exit!
Aborted
root@xtest:~# ^C
root@xtest:~# ^C
root@xtest:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 29
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> Ctrl-C -- exit!
Aborted
root@xtest:~# sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 30
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' =Ctrl-C -- exit!56');
Aborted
root@xtest:~# ^C
root@xtest:~# ^C
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~# service mysql start
root@xtest:~# service mysql stop
root@xtest:~# service mysql start
root@xtest:~#
root@xtest:~#
root@xtest:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> Ctrl-C -- exit!
Aborted
root@xtest:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> Ctrl-C -- exit!
Aborted
root@xtest:~# ^C
root@xtest:~# ^C
root@xtest:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');Ctrl-C -- exit!
Aborted
root@xtest:~# ^C
root@xtest:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password'' at line 1
MariaDB [(none)]> Ctrl-C -- exit!
Aborted
root@xtest:~#
root@xtest:~#
root@xtest:~# service mysql stop
root@xtest:~#
root@xtest:~#
root@xtest:~# mysqld_safe --skip-grant-tables &
[1] 5785
root@xtest:~# 181210 16:20:28 mysqld_safe Logging to syslog.
181210 16:20:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

root@xtest:~# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> update user set password=PASSWORD("123456") where User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye
root@xtest:~# service mysql restart








Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
root@xtest:~#
[/CODE]
 
Werbung:
Was die hier schreiben scheint der reinste Schwachsinn zu sein, da geht gar nix mehr mit service restart: How to Reset MariaDB Root Password

das sieht mir allerdings exakt so aus wie es gehen sollte und wie wir das im Support früher gemacht haben (ich war bis vor knapp 3 Jahren bei einem Hosting-Provider).
Aber hey - ich habe MySQL nie gemocht und das alles erfolgreich vergessen ...
 
Das Problem war, dass ich nach MySQL- statt nach MariaDB-Anleitungen gesucht habe, da gibt es doch keine Unterschiede.

P.S.: Mag auch weder MySQL noch HeidiSQL besonders, irgendwie sind diese Datenbanken ziemlich "möchtegern", da gibt es definitiv besseres was ebenfalls OpenSource ist. Z.B. PostgreSQL. SAP MaxDB ist soviel ich weiss auch kostenfrei wenn man es nicht zusammen mit dem SAP-ERP einsetzt und wohl auch sehr leistungsfähig. Davon gibt es, soviel ich weiss, auch keine versch. Versionen wie Lite, Express, Standard, Enterprise, was auch immer! Allerdings ist es eher nicht so verbreitet...
 
Werbung:
Zurück
Oben