Last active
October 1, 2015 20:07
-
-
Save merolhack/0188cb404c6f61f4e775 to your computer and use it in GitHub Desktop.
REHL(Centos & Oracle Linux): Instalación y configuración de MySQL
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
# Instalar MySQL de los repositorios de REMI | |
yum --enablerepo=remi install mysql mysql-server -y | |
# Iniciar servicio | |
service mysqld start | |
# Iniciar servicio al iniciar el sistema | |
chkconfig mysqld on |
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
# Agregar regla a IPTables para el puerto 3306 | |
iptables -I INPUT 5 -p tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT | |
# Guardar regla: | |
service iptables save |
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
# Ejecutar script para configurar MySQL | |
/usr/bin/mysql_secure_installation | |
Set root password? [Y/n] Y | |
Remove anonymous users? [Y/n] Y | |
Disallow root login remotely? [Y/n] n | |
Remove test database and access to it? [Y/n] Y | |
Reload privilege tables now? [Y/n] Y |
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
# Ingresar vía consola como usuario root: | |
mysql -h localhost -u root -p | |
# 1. Crear base de datos: | |
CREATE DATABASE NOMBRE_SCHEMA | |
DEFAULT CHARACTER SET utf8 | |
DEFAULT COLLATE utf8_general_ci; | |
# 2. Crear usuario: | |
CREATE USER 'NOMBRE_USUARIO'@'%' | |
IDENTIFIED BY 'CONTRASEÑA'; | |
# 3. Otorgar privilegios: | |
GRANT ALL PRIVILEGES ON NOMBRE_SCHEMA.* | |
TO 'NOMBRE_USUARIO'@'%'; | |
# 4. Refrescar privilegios: | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment