如果仍有编码不是utf8的,请检查配置文件,也可使用mysql命令设置:
set character_set_client = utf8;
set character_set_server = utf8;
set character_set_connection = utf8;
set character_set_database = utf8;
set character_set_results = utf8;
set collation_connection = utf8_general_ci;
set collation_database = utf8_general_ci;
set collation_server = utf8_general_ci;
show variables like 'char%';
create user 'jbjb'@'%' identified by '4d@wjb13191835106';
GRANT ALL ON exp_test.* TO 'jbjb'@'%';
flush privileges;
grant all on express_test.* to 'jbjb'@'%' identified by '4d@wjb13191835106';
flush privileges;
use mysql
mysql> select user,host,plugin from user;;
+---------------+-----------+-----------------------+
| user | host | plugin |
+---------------+-----------+-----------------------+
| root | localhost | mysql_native_password |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| root | % | mysql_native_password |
+---------------+-----------+-----------------------+
4 rows in set (0.00 sec)
或者
select user,host, authentication_string from user;