Previous tests were conducted in the environment of mysql5.5 or MariaDB. I have never used Mysql 8, so when the environment changed to Mysql 8, I encountered many problems. In order to avoid forgetting in the future and make it easier to look up information at any time, here Record the pitfall situation.
Question 1: Execute sql: select user, password, host from user; when querying user password, prompt: ERROR 1054(42S22):Unkown column 'password' ; in 'field list' The phenomenon is as shown below:
Cause of the problem: The password field is used to mark the password field in the user table in the mysql database in versions below mysql 8, but the password field in mysql 8 has been changed to:authentication_string
So when the environment changes to mysql 8, the corresponding sql statement should become: select user, authentication_string, host from user;
Question 2: When using the navicat tool to connect to the msyql 8 server, the prompt is: 1251- Client deos not support authentication protocol requested by server; consider upgrading MySQL client. The problem is as shown below (similar prompts will appear if the mysql client version run through the command is lower than 8):
Cause of the problem: The password verification mechanism of mysql8 is different from previous versions. One of the specific manifestations is the password fields password and authentication_string mentioned above. The password encryption protocol used by the connection tool of lower versions does not meet the requirements of mysql 8. , so you only need to change the client connection tool so that it supports the protocol corresponding to mysql 8.
Solution: The connection tool that can be used for Mysql8, a download link is also provided here (23 messages) The navicat tool and jdbc connection driver suitable for Mysql8 - MySQL Document Class Resources-CSDN Library
After installing the new connection tool, connect it according to the normal connection method.