Instalacion Mysql en Digital Ocean
Comandos de Consola
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
FLUSH PRIVILEGES;
exit
mysql -u root -p
CREATE USER 'admin'@'%' IDENTIFIED BY '123456789';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
sudo ufw allow 3306
CREATE USER 'prueba'@'%' IDENTIFIED WITH caching_sha2_password BY '1234567';
GRANT ALL PRIVILEGES ON *.* TO 'prueba'@'%' WITH GRANT OPTION;
ALTER USER 'prueba'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
0.0.0.0
sudo systemctl restart mysql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Jonatan123';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Jonatan123';
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Jonatan123');
UPDATE mysql.user SET authentication_string = PASSWORD('Jonatan123') WHERE User = 'root' AND Host = 'localhost';