1. apt update
2. apt install mysql-server
3.安全脚本(可以不运行)
4.配置utf8字符集编码
vim /etc/mysql/mysql.conf.d/mysqld.cnf
在[mysqld]添加:
character_set_server=utf8
注:在配置utf8之前,要停止mysql
1) service mysql stop 2)service mysql restart
查看编码配置效果:
show variables like 'character_set_%';