I have newly installed MySQL 5.7. When I log in, I get a message saying that the password is wrong. I did not change the password during installation. Later, I changed the password by logging in without a password. When I enter update mysql.user set password=password('root') where user='root', I get a message saying ERROR 1054 (42S22): Unknown column 'password' in 'field list'. It turns out that there is no password field in the MySQL database. The password field has been changed to authentication_string. So change the statement to update mysql.user set authentication_string=password('root') where user='root'; My system version is as follows: The complete procedure for changing the MySQL password is as follows: 1. vim /etc/my.cnf add skip-grant-tables 2. Restart MySQL, /etc/init.d/mysqld restart 3. Enter mysql in the terminal to log in to the MySQL database directly, and then use mysql To change the password in MySQL 5.7, you should use the command ALTER USER 'root'@'localhost'IDENTIFIED BY '********', in which the password naming rule has changed. The password set for MySQL must contain at least one uppercase letter, one lowercase letter, one special symbol, and one number. 5. Edit the my.cnf file and delete the skip-grant-tables line, then restart MySQL, /etc/init.d/mysqld restart, otherwise MySQL can still log in without a password 6.mysql -u root -p Then enter the password to log in to the MySQL database The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to get the current time using time(NULL) function and localtime() in Linux
>>: Vue Router loads different components according to background data
The cursor size in the input box is inconsistent T...
1. Background During the server development proce...
Does performance really matter? Performance is im...
Deploy nginx with docker, it's so simple Just...
Why? The simplest way to put it is that pixels are...
It is already 2020. Hungry humans are no longer s...
Table of contents Preface Prototypal inheritance ...
Whether it is Samba service or NFS service, the m...
SQL paging query:background In the company's ...
Preface Using css to generate dotted lines is a p...
This article example shares the specific code of ...
Table of contents 1. Introduction to pid-file 2.S...
1. Download the accelerated version of msyql dock...
1. Why does nginx use gzip? 1. The role of compre...
Table of contents 1. Index Basics 1. Types of Ind...