Encontranos en redes
MySQLWindowsBase de datos7 min de lectura
Instalar MySQL en Windows Server
Instalá MySQL en Windows Server, configurá el servicio y creá bases de datos y usuarios.
MySQL es el motor de bases de datos open source más popular. En Windows Server se instala mediante el MSI Installer oficial.
Paso 1 — Descargar MySQL
Descargá el instalador MSI desde PowerShell:
powershell
New-Item -Path "C:\MySQLSetup" -ItemType Directory -Force
Invoke-WebRequest -Uri "https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.4.0.0.msi" -OutFile "C:\MySQLSetup\mysql-installer.msi"O descargalo manualmente desde https://dev.mysql.com/downloads/installer/
Paso 2 — Ejecutar la instalación
Doble clic en el MSI y seleccioná «Server only» para instalar solo el motor.
Durante la configuración:
- Type: Server Computer
- Authentication: Use Strong Password Encryption
- Root Password: definí una contraseña fuerte
- Windows Service: marcá «Configure MySQL Server as a Windows Service»
- Service Name: MySQL84
- Start at System Startup: Sí
Paso 3 — Verificar el servicio
powershell
Get-Service MySQL84Paso 4 — Agregar MySQL al PATH
powershell
$env:PATH += ";C:\Program Files\MySQL\MySQL Server 8.4\bin"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH, "Machine")Paso 5 — Conectarse y crear base de datos
powershell
mysql -u root -pDentro de MySQL:
sql
CREATE DATABASE mi_aplicacion CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'app_user'@'%' IDENTIFIED BY 'ContraseñaSegura123!';
GRANT ALL PRIVILEGES ON mi_aplicacion.* TO 'app_user'@'%';
FLUSH PRIVILEGES;
EXIT;Paso 6 — Abrir puerto en firewall
powershell
New-NetFirewallRule -DisplayName "MySQL" -Direction Inbound -Protocol TCP -LocalPort 3306 -Action AllowPaso 7 — Configurar acceso remoto
Editá C:\ProgramData\MySQL\MySQL Server 8.4\my.ini:
ini
[mysqld]
bind-address = 0.0.0.0Reiniciá el servicio:
powershell
Restart-Service MySQL84Comandos de gestión
powershell
Start-Service MySQL84
Stop-Service MySQL84
Restart-Service MySQL84Cadena de conexión
terminal
Server=TU_IP;Port=3306;Database=mi_aplicacion;Uid=app_user;Pwd=ContraseñaSegura123!;¿Te resultó útil esta guía?