MySQL相关

以下是在最近对MySQL 8.0操作过程中的一些问题,现记录下来,以备下次参考:

一、更改MYSQL密码

在旧版本中,要重置SQL密码,需要在MYSQL中执行的是:

mysql> update user set password=password('123') where user='root' and host='localhost';  
mysql> flush privileges;  

在新版本中,这条语句有变化

ALTER USER USER() IDENTIFIED BY '新密码';

二、 Warning: 3719

[Warning: (3719, “‘utf8’ is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.”)

(1)修改my.ini

[client]
port=3306
default-character-set=utf8mb4
[mysqld]
port=3306
character_set_server=utf8mb4
basedir=D:\MySql\mysql-8.0.12-winx64\bin
datadir=D:\MySql\mysql-8.0.12-winx64\data
federated
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

(2)修改创建表语句

修改默认字符集 :

DEFAULT CHARSET=utf8mb4

你可能感兴趣的:(MySQL相关)