编程的魅力
首页
分类
标签
归档
动态
关于我
hyuga
2020-07-18
104
2020-08-05 10:12:39
原创
MySQL设置支持表情符存储
# 服务器 Linux # 步骤 - 打开mysql配置文件`vim /etc/my.cnf` - 末端插入以下配置 ``` [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] character-set-client-handshake=FALSE character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4' ``` - 保存退出`:wq` - 重启mysql`/usr/local/mysql/bin/mysqld restart` - 更改表结构 `ALTER TABLE t_dynamic CONVERT TO CHARACTER SET utf8mb4;` --- OK,可以保存了! # 注意 `/usr/local/mysql/bin/mysqld restart`失败: ``` [root@VM_0_6_centos mysql]# /usr/local/mysql/bin/mysqld restart 2020-08-05 10:10:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2020-08-05 10:10:12 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2020-08-05 10:10:12 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.43) starting as process 2216 ... 2020-08-05 10:10:12 2216 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 2020-08-05 10:10:12 2216 [ERROR] Aborting 2020-08-05 10:10:12 2216 [Note] Binlog end 2020-08-05 10:10:12 2216 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete ``` 请用以下命令重启: `/usr/local/mysql/support-files/mysql.server restart` ``` [root@VM_0_6_centos mysql]# ./support-files/mysql.server restart Shutting down MySQL.... SUCCESS! Starting MySQL. SUCCESS! ```
MySQL
评论
发布
留言
评论