MySQL FAQs (in continuous update)

Source: Internet
Author: User

MySQL Ver 14.14 distrib 5.7.21, for Linux (x86_64) using Editline Wrapper

How to find a MySQL configuration file

My.ini under Windows
Linux under/etc/my.cnf, can also be found by command $ whereis my

ERROR 2002 (HY000)

It is possible to report such a mistake when you have just installed root login:

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘

The reason for this is the/var/lib/mysql access rights issue.
The following command changes the owner of the/var/lib/mysql to the current user:

$ sudo chown -R root:root /var/lib/mysql
ERROR 1054 (42S22): Unknown column ' Password ' in ' Field list '

In the password field of the user table that modifies the MySQL database, the Times is wrong,

update user set password=password(“新密码”) where user=”用户名”;

The reason is that in MySQL 5.7, the password field is renamed to Authentication_string, using the following command

update user set authentication_string=password(“新密码”) where user=”用户名”;
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

The error occurs when the password is incorrect, and the following is the Reset method

$ sudo vi /etc/my.cnf# 在[mysqld]段加入skip-grant-tables,作用是令MySQL不需要密码登陆$ service mysqld restart$ mysql -u root -p# 回车进入MySQL> use mysql;> update set authentication_string=password(‘newpassword‘) where user=‘root‘;> flush privileges;> quit;$ sudo vi /etc/my.cnf# 删除skip-grant-tables$ service mysqld restart$ mysql -u root -p# 以‘newpassword‘即可登录

The flush Privileges command essentially works by extracting the user information/permission settings from the current users and Privilige tables from the MySQL library (the built-in library of the MySQL database) into memory. MySQL user data and permissions have been modified, you want to "do not restart the MySQL service" in the case of direct effect, then you need to execute this command. Usually after you modify the root account settings, afraid to restart after the login can no longer, then directly after the flush to see whether the permissions are set to take effect. Without risking too much.

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before Executin

Password does not and MySQL meaning, to change:

alteruser‘root‘@‘localhost‘identifiedby‘password‘;

MySQL FAQs (in continuous update)

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.