Methods for changing passwords before MySQL 5.7: Method 1: Use the SET PASSWORD command
Method 2: Using mysqladmin
If the root password has been set, use the following method
Method 3: Use UPDATE to edit the user table directly
When you lose your root password, you can
The way to change the password in MySQL 5.7.22 is as follows: 1. Version update. The password field in the original user has been changed to authentication_string. Due to the version update, many online tutorials are no longer applicable, and even the official website documents cannot be operated smoothly. If MySQL is running, kill it first: killall -TERM mysqld. Run mysqld_safe --skip-grant-tables & If you do not want to be connected remotely at this time: mysqld_safe --skip-grant-tables --skip-networking & Use mysql to connect to the server and change the password
*One thing to note is that there is no Password field in the user table under the new version of MySQL database. Instead, the encrypted user password is stored in the authentication_string field. 2. The following error is reported when upgrading MySQL: ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with MySQL 50556, now running 50722. Please use mysql_upgrade to fix this error. The error is caused by the fact that you have upgraded the database before and did not use mysql_upgrade to upgrade the data structure after the upgrade. Solution: Use the mysql_upgrade command
3. Change the password after installing the MySQL5.7.22 database;
After entering mysql, you need to change the global variables. Otherwise, the password you set must meet the password complexity requirements.
Or like this:
You may also be interested in:
|
<<: Things about installing Homebrew on Mac
>>: Detailed explanation of Vue's sync modifier
Shtml and asp are similar. In files named shtml, s...
The following is a picture mouse hover zoom effec...
Preface: Based on a recent medical mobile project...
HTML: Title Heading is defined by tags such as &l...
Table of contents Written in front Precautions De...
By default, setting width for label and span is in...
Table of contents Layout part: <div id="a...
Adding the right VS Code extension to Visual Stud...
Shorthand properties are used to assign values ...
Preface Workbench is installed on one computer, a...
The loading speed of a web page is an important in...
We know that MySQL is a persistent storage, store...
Suppose we have n items and we have to sort these...
Floating ads are a very common form of advertisin...
Sometimes you need to install certain dependencie...