BLOG

CentOS Mysql + systemd reset root password

Reset root hesla pri mysql serveru a systemd

1. Stop mysql:
systemctl stop mysqld

2. Set the mySQL environment option 
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"

3. Start mysql usig the options you just set
systemctl start mysqld

4. Login as root
mysql -u root

5. Update the root user password with these mysql commands
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
    -> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

*** Edit ***
As mentioned my shokulei in the comments, for 5.7.6 and later, you should use 
   mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Or you'll get a warning

6. Stop mysql
systemctl stop mysqld

7. Unset the mySQL envitroment option so it starts normally next time
systemctl unset-environment MYSQLD_OPTS

8. Start mysql normally:
systemctl start mysqld

Try to login using your new password:
7. mysql -u root -p

Zdroj:

https://stackoverflow.com/questions/33510184/change-mysql-root-password-on-centos7
   Send article as PDF   
27. marca 2020 Linux
Žiadne komentáre

Ansible pridanie hosta

Zobrazenie informácií o certifikáte

Pridaj komentár Zrušiť odpoveď

  +  81  =  90

Najnovšie články

  • Windows server 2022 printer add 16. septembra 2024
  • Elasticsearch docker ssl 27. júla 2024
  • Azure AuditEnterpriseAppsAzure 7. júla 2024
  • MSSQL server create external account from entra ID 20. marca 2024
  • ubuntu bring up all interface and show actual speed 17. januára 2024
  • RDP password BruteForce 12. decembra 2023
  • CiscoUCS 6XXX reboot 10. júna 2023

Najnovšie komentáre

  • Róbert Čečetka komentoval Zobrazenie všetkých stĺpcov z MYSQL cez PHP a html

Archív

  • september 2024
  • júl 2024
  • marec 2024
  • január 2024
  • december 2023
  • jún 2023
  • máj 2023
  • marec 2023
  • december 2022
  • október 2022
  • august 2022
  • júl 2022
  • máj 2022
  • apríl 2022
  • marec 2022
  • október 2021
  • september 2021
  • august 2021
  • jún 2021
  • máj 2021
  • apríl 2021
  • marec 2021
  • február 2021
  • január 2021
  • december 2020
  • november 2020
  • október 2020
  • september 2020
  • august 2020
  • júl 2020
  • jún 2020
  • máj 2020
  • apríl 2020
  • marec 2020
  • február 2020
  • január 2020
  • december 2019

Kategórie

  • Active Directory (3)
  • Ansible (1)
  • apereo (3)
  • BIaKS (2)
  • checkpoint (4)
  • CISCO (40)
  • docker (4)
  • emby (2)
  • freeradius (7)
  • Lenovo-IBM (1)
  • Linux (79)
  • Mikrotik (2)
  • monitoring (34)
  • Nezaradené (24)
  • PLESK (3)
  • Programovanie (13)
  • VEEAM (2)
  • VMware (38)
  • Windows (17)
  • Zabezpecenie (5)

Meta

  • Prihlásiť sa
  • Feed záznamov
  • RSS feed komentárov
  • WordPress.org
Hrdo poháňa WordPress | Téma: Neblue od NEThemes.