The method of MySQL password cracking under Linux

Source: Internet
Author: User

A.

    1. First stop the service/etc/init.d/mysqld stop and add it in/ETC/MY.CNF:

      Socket=/var/lib/mysql/mysql.sock
      Skip-grant-tables
      User=mysql

    2. Start MySQL service, enter MySQL login

    3. mysql> use MySQL;
      Reading table information for completion of table and column names
      Can turn off this feature to get a quicker startup with-a

    4. Database changed
      mysql> Update user Set Password=password (' Lixi ') where user= ' root ';
      Query OK, 3 rows affected (0.02 sec)
      Rows Matched:3 Changed:3 warnings:0

    5. mysql> flush Privileges;
      Query OK, 0 rows affected (0.01 sec)

    6. Restart MySQL after modifying and then log in with your own modified password to OK

B. Source code installation mysql and password hack

  1. [email protected]_168_2_193 ~]# cat/etc/issue
    CentOS Release 6.4 (Final)
    Kernel \ r on an \m

  2. [Email protected]_168_2_193 ~]# uname-r
    2.6.32-358.el6.x86_64

  3. MySQL download wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.63.tar.gz

  4. Tar xzf mysql-5.1.63.tar.gz; CD mysql-5.1.63;. /configure--prefix=/usr/local/mysql
    --enable-assembler &&make-j8&&make-j8 Install

  5. Configuring MySQL for System services

  6. Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cnf
    Cp/usr/local/mysql/share/mysql/mysql.server/etc/rc.d/init.d/mysqld
    Chkconfig--add mysqld
    Chkconfig--level mysqld on
    /etc/init.d/mysqld restart

  7. Setting relevant parameters and initializing the database

  8. Useradd MySQL
    Chown-r Mysql.mysql/usr/local/mysql
    /usr/local/mysql/bin/mysql_install_db--user=mysql--datadir=./var
    --basedir=/usr/local/mysql/
    Chown-r mysql.mysql var
    /usr/local/mysql/bin/mysqld_safe--user=mysql &

  9. /usr/local/mysql/bin/mysqld_safe--user=mysql--skip-grant-tables & Skip Permissions start background

  10. /usr/local/mysql/bin/mysql Login Use Mysql;update user set Password=password (' Lixi ') where user= ' root '; flush privileges;/ Etc/init.d/mysqld restart

This article is from the "Fluffy Duck" blog, please be sure to keep this source http://woshitieren.blog.51cto.com/2466034/1672546

The method of MySQL password cracking under Linux

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.