Skip to content

Instantly share code, notes, and snippets.

@wagura-maurice
Last active January 4, 2023 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wagura-maurice/8fa47a59b7cc6f3326358d3e564562a6 to your computer and use it in GitHub Desktop.
Save wagura-maurice/8fa47a59b7cc6f3326358d3e564562a6 to your computer and use it in GitHub Desktop.
MySQL root access from all hosts
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