首页 > 代码库 > mysql 相关环境配置
mysql 相关环境配置
1. mysql 版本要求 5.5 以上, 否则不支持 emoji 表情.
$ sudo apt-get install mysql-server$ sudo vim /etc/mysql/my.cnf # charset utf8mb4. mysql 5.5 required[client]default-character-set = utf8mb4[mysql]default-character-set = utf8mb4[mysqld]character-set-client-handshake = FALSEcharacter-set-server = utf8mb4collation-server = utf8mb4_unicode_ciinit_connect=‘SET NAMES utf8mb4‘$ sudo service mysql restart$ mysql -uroot -p # login and checkmysql> SHOW VARIABLES WHERE Variable_name LIKE ‘character\_set\_%‘ OR Variable_name LIKE ‘collation%‘;+--------------------------+--------------------+| Variable_name | Value |+--------------------------+--------------------+| character_set_client | utf8mb4 || character_set_connection | utf8mb4 || character_set_database | utf8mb4 || character_set_filesystem | binary || character_set_results | utf8mb4 || character_set_server | utf8mb4 || character_set_system | utf8 || collation_connection | utf8mb4_unicode_ci || collation_database | utf8mb4_unicode_ci || collation_server | utf8mb4_unicode_ci |+--------------------------+--------------------+10 rows in set (0.00 sec)# security grant mysql> use mysql;mysql> delete from user where user = ‘‘;Query OK, 2 rows affected (0.00 sec)
mysql 相关环境配置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。