Al usar este sitio, estás de acuerdo con el política de privacidad.
Aceptar
EnterineEnterineEnterine
  • HOGAR
  • TI PRO
  • TECNOLOGÍA
  • Microsoft
    • Azur
    • Administrador de configuración/SCCM
    • Dpm
    • orquestador
    • Hiper-V
    • Información privilegiada de Microsoft Edge
    • MSI
    • Oficina 365
    • Información privilegiada de la oficina
    • Energía BI
    • Skype
    • Servidor SQL
    • equipos
  • VENTANAS
    • Centro de administración de Windows
    • Cliente de Windows
    • Servidor Windows
  • Lista de recopilación de consultas SCCM
Lectura: Reset MySQL Root Password on Linux: Una guía paso a paso
Cambiar tamaño de fuenteAutomóvil club británico
EnterineEnterine
Cambiar tamaño de fuenteAutomóvil club británico
  • HOGAR
  • TI PRO
  • TECNOLOGÍA
  • Microsoft
  • VENTANAS
  • Lista de recopilación de consultas SCCM
Buscar
  • HOGAR
  • TI PRO
  • TECNOLOGÍA
  • Microsoft
    • Azur
    • Administrador de configuración/SCCM
    • Dpm
    • orquestador
    • Hiper-V
    • Información privilegiada de Microsoft Edge
    • MSI
    • Oficina 365
    • Información privilegiada de la oficina
    • Energía BI
    • Skype
    • Servidor SQL
    • equipos
  • VENTANAS
    • Centro de administración de Windows
    • Cliente de Windows
    • Servidor Windows
  • Lista de recopilación de consultas SCCM
mysql

Reset MySQL Root Password on Linux: Una guía paso a paso

Publicado: Febrero 18, 2024
3 Lectura mínima
COMPARTIR

Reset MySQL Root Password on Linux: Una guía paso a paso.

Losing or forgetting the MySQL root password can be a daunting situation for database administrators. Sin embargo, on a Linux system, there are methods to reset the MySQL root password and regain access to your database. En este artículo, we will guide you through the process of resetting the MySQL root password on Linux by modifying the MySQL configuration file (my.cnf), ensuring the security and integrity of your valuable data.

1. The first step in resetting the MySQL root password is to stop the MySQL service to prevent any active connections. Open a terminal on your Linux system and execute the following command:

sudo systemctl stop mysql

2. Próximo, you need to modify the MySQL configuration file (my.cnf) to disable the authentication process temporarily. Open the file using a text editor:

sudo nano /etc/mysql/my.cnf

Localizar el [mysqld] section in the file and add the following line below it:

skip-grant-tables

NOTA: In case, when [mysqld] not exist use this code:

[mysqld]
skip-grant-tables

Guarde los cambios y salga del editor de texto.

3. After modifying the configuration file, you need to restart the MySQL service for the changes to take effect. Execute the following command in the terminal:

sudo systemctl restart mysql

NOTA: The MySQL service will now start without checking the user privileges, allowing you to reset the root password without providing the current password.

4. Now that MySQL is running with the authentication process disabled, open a terminal and connect to the MySQL server using the following command:

mysql -u root

Once connected to the MySQL server, execute the following SQL statement to flush privileges:

FLUSH PRIVILEGES;

NOTA: Without it, you will get errors on any user operations.

Once connected to the MySQL server, execute the following SQL statement to update the root password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

Replace ‘new_password’ with your desired password. After running the query, you can exit the MySQL prompt by typing exit o quit.

FLUSH PRIVILEGES;
exit;

NOTA: Don’t forget to comment code on my.cnf

#[mysqld]
#skip-grant-tables
ETIQUETADO:AlmaLinuxCentOSdblinuxmysqlubuntu
Artículo anterior How to Update Sysmon on Windows – Step by Step Guide
Artículo siguiente Información privilegiada de la oficina 2212 para Windows
Deja un comentario Deja un comentario

Deja una respuesta Cancelar respuesta

Su dirección de correo electrónico no será publicada. Los campos obligatorios están marcados *

Este sitio utiliza Akismet para reducir el spam.. Descubra cómo se procesan los datos de sus comentarios.

Traducción

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
por Transposh - Plugin de traducción para WordPress

Publicaciones populares

Requisitos del sistema para Windows Server 2016
Servidor Windows
Lista de recopilación de consultas del Administrador de configuración
Lista de recopilación de consultas del Administrador de configuración
ConfigMgr
Navegación estructurada/administrada habilitada en páginas modernas en sitios de equipo clásicos
Técnico
SCCM no pudo obtener las ubicaciones de DP como la versión esperada de MP
ConfigMgr

Publicaciones recientes

Instalación y configuración de Fail2ban para protección SSH en Ubuntu 24.04
linux
Habilitación y configuración de FirewallD en AlmaLinux
linux
Creación de usuarios y configuración de claves SSH en AlmaLinux
linux
Cómo restablecer la contraseña en AlmaLinux
linux

© 2023 Enterine

Ir a la versión móvil
Bienvenido de nuevo!

Inicia sesión en tu cuenta

Nombre de usuario o dirección de correo electrónico
Contraseña

Perdiste tu contraseña?