• 周六. 10 月 5th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

MySQL 5.7 modify root account password

King Wang

1 月 3, 2022

install MySQL5.7 initialization failed

stay mysql install After the command runs successfully , Then run mysqld –initialize The command completes the database initialization function , This is the encounter with error: Found option without preceding group in config file: /data/3307/my.cnf at line: 1

reason :my.ini The file format is utf-8
terms of settlement ,my.ini The file is saved as ANSI Format file

MySQL5.7 modify root Account password

  1. Go to the installation directory bin Catalog , Command line execution :
    mysqld –skip-grant-tables

  2. Will get stuck , Don’t mind , Do not shut down. ;

  3. Open a command window again in the directory , Direct input mysql, enter

  4. Input use mysql; Choose to use mysql database

  5. Execute statement :
    update user set authentication_string=password(‘root’) where user=‘root’;

  6. This changes the password to root 了

Be careful : You need to close your mysql service

发表回复