MySQL forgot root password do not restart Mysqld method

Source: Internet
Author: User

Tag:cti   copyright    backup    ati   acl     forgot root password    match   warning   gre   

MySQL Forget root password does not restart Mysqld method  1, first there must be a MySQL database account can have Modify permissions, the current MySQL instance account (lower-privileged account, such as can modify the Zabbix database) or other instances of the same version of the account. Copy the files associated with the user table below the Data/mysql directory to the Data/zabbix directory.  [[email protected] mysql]# CP mysql/user.* test/[[email protected] mysql]# chown mysql.mysql test/user . * 2, use another lower-privileged account link database to set the user-stored password data in the Zabbix database.   [[email protected] mysql]# mysql-uzabbix-pzabbixpasswd-a mysql: [Warning] Using A password on th e command line interface can insecure. Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 1180Server version:5.7.22-log mysql Community Server (GPL)  copyright (c) 2000, 201 8, Oracle and/or its affiliates. All rights Reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names is trademarks of their respectiveowners. type ' help, ' or ' \h ' for help. Type ' \c ' to clear the current input statement. mysql> use zabbix;database changedmysql> updAte user set Authentication_string=password (' zabbixpasswd ') where user= ' root '; Query OK, 2 rows affected, 1 warning (0.04 sec) rows Matched:2 changed:2 warnings:1  3, put the modified user. MyD and user.myi Copy to the MySQL directory, remember to back up the previous files.  MV Mysql/user. MYD Mysql/user. MYD.BAKMV Mysql/user. MYI Mysql/user. MYI.BAKCP Zabbix/user. my* mysql/chown mysql.mysql mysql/user.* 4, kill-sighup  [[email protected] mysql]# pgrep-n Mysql31650[[email protected] mysql]#[[email protected] mysql]# kill-sighup 31650 5, test [[email  Protected] mysql]# mysql-uroot-pzabbixpasswd-a mysql: [Warning] Using A password on the command line interface can Be insecure. Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 1190Server version:5.7.22-log mysql Community Server (GPL)  copyright (c) 2000, 201 8, Oracle and/or its affiliates. All rights Reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names MayBe trademarks of their respectiveowners. type ' help, ' or ' \h ' for help. Type ' \c ' to clear the current input statement. mysql> 

MySQL forgot root password do not restart Mysqld method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.