Last active
January 4, 2023 17:37
-
-
Save wagura-maurice/8fa47a59b7cc6f3326358d3e564562a6 to your computer and use it in GitHub Desktop.
MySQL root access from all hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ufw allow from any to any port 3306 proto tcp | |
sudo apt update | |
sudo apt install mysql-server | |
sudo mysql_secure_installation | |
sudo mysql | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'; | |
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$'; | |
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Rtcv39$$'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; | |
FLUSH PRIVILEGES; | |
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf | |
[mysqld] | |
skip-log-bin = true | |
sudo systemctl restart mysql | |
rm -rf /var/lib/mysql | |
mysql -u root -h 0.0.0.0 -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment