Workaround (ERROR 1698 (28000): Access denied for user ' root ' @ ' localhost ') cannot be logged after MySQL installation

Source: Internet
Author: User

  1. Workaround (ERROR 1698 (28000): Access denied for user ' root ' @ ' localhost ') cannot be logged after MySQL installation

    Steps to resolve:

    [====>>https://www.cnblogs.com/leolztang/p/5094930.html1. sudo mysql-u root-P2.SelectUser, Plugin fromMysql.user;3. Update Mysql.userSetAuthentication_string=password ('newpwd'), plugin='Mysql_native_password' whereUser='Root';4. Flush privileges;5. exit


    6. Restart the entry


    1. Delete MySQL

    A. sudo apt-get autoremove--purge mysql-server-5.0B. sudo apt-get Remove mysql- serverc. sudo apt-get autoremove mysql-serverd. sudo apt-get Remove Mysql-common ( Very important)


    In fact, some of the above is redundant, it is recommended to follow the order

    2. Clean up residual data

    ' {print $} ' |sudo xargs dpkg-p



    3. Install MySQL

    A. sudo apt-get install mysql-serverb. sudo apt-get install mysql-clientc. sudo apt- Get Install php5-mysql (install Php5-mysql to connect PHP with MySQL)



    Once the installation is complete, the MySQL server should start automatically. You can check whether the MySQL server is running by running the following command at the terminal prompt:

    4. Check if MySQL is running

    sudo netstat-tap | grep MySQL


    When you run the command, you can see a line similar to the following:

    [email protected]:~# sudo netstat-tap |  00 localhost.localdo:mysql *:*870/mysqld


    If the server does not function correctly, you can start it by using the following command:

    Sudo/etc/init.d/mysql restart

    Open MySQL:

    sudo mysql

    This article is mainly excerpted from: 78901889






Workaround (ERROR 1698 (28000): Access denied for user ' root ' @ ' localhost ') cannot be logged after MySQL installation

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.