linux下的mysql修改默认编码_MySQL
程序员文章站
2024-02-04 11:13:28
...
安装mysql
sudo apt-get install mysql-server
查看mysql默认编码
show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
修改mysql的默认编码
sudo gedit /etc/mysql/my.cnf
在[mysqld]
#
# * Basic Settings
#
下面加上
character_set_server=utf8
修改完成后保存然后重启mysql
sudo /etc/init.d/mysql restart
sudo apt-get install mysql-server
查看mysql默认编码
show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
修改mysql的默认编码
sudo gedit /etc/mysql/my.cnf
在[mysqld]
#
# * Basic Settings
#
下面加上
character_set_server=utf8
修改完成后保存然后重启mysql
sudo /etc/init.d/mysql restart
上一篇: 蚂蚁篇无聊吗?看看猎人骨灰粉丝绝妙分析(1) 情感笑话
下一篇: 直接返回数组的方法是最慢的
推荐阅读
-
linux下的mysql修改默认编码_MySQL
-
centos下yum搭建安装linux+apache+mysql+php环境的方法
-
Linux下的MySQL远程客户端无法连接_MySQL
-
wamp下修改mysql访问密码的解决方法_PHP
-
Linux下打开MySQL慢查询记录的配置方法
-
Linux+Nginx+MySQL下配置论坛程序Discuz的基本教程_php实例
-
php在linux下检测mysql同步状态的方法_PHP教程
-
linux下指定mysql数据库服务器主从同步的配置实例_MySQL
-
Linux下的MySQL自动备份工具-第二版
-
windows和Linux环境下php apache mysql 环境的搭建教程