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
In MySQL, you can specify multiple indexes for a ...
Today I will share with you a good-looking counte...
1. Execute SQL to view select @@session.sql_mode;...
In MySQL, we often use order by for sorting and l...
How to install and configure mysql-5.7.5-m15-winx...
Today I helped a classmate solve a problem - Tomc...
Implementation requirements The form imitating El...
Preface Named slots are bound to elements using t...
Table of contents 1. Encapsulate complex page dat...
1. Introduction This article will show you how to...
Table of contents text LOCK parameter ALGORITHM p...
download: Step 1: Open the website (enter the off...
According to the principles of W3C, each start tag...
Recently, when I was learning Django, I needed to...
This article shares the installation and configur...