====== MySQL ======
MySQL 🇩🇪 ist eine leistungsfähige Datenbank-Serveranwendung. Die Firma MySQL AB, welche hinter der Entwicklung der Datenbank steht, wurde im Jahr 2008 von Sun übernommen und ist seit der Übernahme von Sun durch Oracle nun dieser Firma zugehörig. MySQL ist neben Linux auch für Windows, MacOS, FreeBSD, Solaris und weitere Betriebssysteme verfügbar.
* https://wiki.ubuntuusers.de/MySQL/
* https://hub.docker.com/_/mariadb/
===== Remote Access =====
* https://www.configserverfirewall.com/ubuntu-linux/enable-mysql-remote-access-ubuntu/
===== MySQL 5.6 installieren =====
* https://stackoverflow.com/questions/62382968/install-mysql-5-6-on-ubuntu-20-04#62387476
===== MySQL komplett deinstallieren =====
sudo apt-get purge mysqld-server
sudo apt autoremove
sudo dpkg -l | grep mariadb
sudo systemctl stop mysqld
sudo systemctl stop nariadb
sudo apt purge mysql-server mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /var/lib/mysql/
sudo rm -rf /etc/mysql/
sudo rm -rf /var/log/mysql
sudo deluser --remove-home mysql
sudo delgroup mysql
sudo add-apt-repository --remove ppa:theppayouused/ppa
===== Datenbanken kopieren =====
* https://stackoverflow.com/questions/5745221/import-frm-and-opt-files-to-mysql#5749704
# In das Verzeichnis /var/lib/mysql
sudo chown -R mysql:mysql /var/lib/mysql
=== Reset Root Passwort ===
All solutions I found were much more complex than necessary and none worked for me. Here is the solution that solved my problem. There isn't any need to restart mysqld or start it with special privileges.
sudo mysql
-- for MySQL
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
-- for MariaDB
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('root');
With a single query we are changing the auth_plugin to mysql_native_password and setting the root password to root (feel free to change it in the query).
Now you should be able to log in with root. More information can be found in MySQL documentation or MariaDB documentation.
(Exit the MySQL console with Ctrl + D or by typing exit.)
===== Installation mysql-workbench =====
* https://linuxhint.com/installing_mysql_workbench_ubuntu/
# Deinstallation
sudo apt remove mysql-workbench-community