Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Instalación y activación del servicio
- sudo apt update && sudo apt install -y mariadb-server
- sudo systemctl status mariadb
- sudo systemctl enable mariadb
- # Inicialmente, sólo se permiten conexiones por ‘unix_socket’ y con el usuario root.
- # Sólo permite el comando mysql o $sudo mysql para acceder al servicio.
- sudo mysql
- # Asignaremos una contraseña al usuario root
- alter user 'root'@'localhost' identified by 'XXXXXXXX';
- # NOTA: para restablecer la conexión por sockets:
- # alter user root@localhost identified via 'unix_socket';
- # Crearemos otro usuario administrador
- # NOTA: 'user'@'%' para permitir la conexión desde cualquier equipo.
- grant all privileges on *.* to 'user'@'ip_address' identified by 'XXXXXXXX' with grant option;
- flush privileges;
- # Para habilitar el acceso remoto al servidor:
- sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
- # Comentaremos el enlace a la red local.
- #bind-address = 127.0.0.1
- sudo systemctl restart mariadb
- # Probaremos desde otra máquina el acceso mediante su hostname o dirección IP:
- mysql -h (Hostname|Dirección-IP) -u USUARIO -p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement