Skip to content

Instantly share code, notes, and snippets.

@SrShark
Last active November 26, 2020 00:25
Show Gist options
  • Save SrShark/433b5ea9ecb06fbcb38234f277081b92 to your computer and use it in GitHub Desktop.
Save SrShark/433b5ea9ecb06fbcb38234f277081b92 to your computer and use it in GitHub Desktop.

Habilitar Servidor MySQL Remoto

Ingresar al servidor mediante ssh.

Editar el archivo de configuración de MySQL.

vim /etc/mysql/mysql.conf.d/mysqld.cnf

Comentar la siguiente linea:

# bind-address = 127.0.0.1

Reiniciar el demonio de MySQL

systemctl restart mysql

Asignar los permisos al usuario para el acceso

Al empezar con MySQL 8 ya no se puede crear un usuario usando el comando GRANT. Se debe usar el comando CREATE USER a cambio y luego aplicar los privilegios.

CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

Actualizar los privilegios

FLUSH PRIVILEGES;

Para entrar en modo sin conexión y con todos los privilegios revisar el siguiente tutorial:

https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-18-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment