Linux MySQL 更改字符集(程序中插入中文乱码 )
来源:互联网 发布:js获取点击事件 编辑:程序博客网 时间:2024/05/21 09:17
- root@ubuntu:~# service mysql start
- start: Job failed to start
- Jun 11 22:56:42 ubuntu kernel: [ 4051.584941] init: mysql main process (4021) terminated with status 7
- Jun 11 22:56:42 ubuntu kernel: [ 4051.584981] init: mysql main process ended, respawning
- Jun 11 22:56:43 ubuntu kernel: [ 4052.134766] init: mysql post-start process (4022) terminated with status 1
- Jun 11 22:56:43 ubuntu kernel: [ 4052.154739] type=1400 audit(1339469803.511:40): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4068 comm="apparmor_parser"
- Jun 11 22:56:44 ubuntu kernel: [ 4053.619246] init: mysql main process (4072) terminated with status 7
- Jun 11 22:56:44 ubuntu kernel: [ 4053.619296] init: mysql main process ended, respawning
- Jun 11 22:56:45 ubuntu kernel: [ 4054.248707] init: mysql post-start process (4073) terminated with status 1
- Jun 11 22:56:45 ubuntu kernel: [ 4054.269778] type=1400 audit(1339469805.627:41): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4119 comm="apparmor_parser"
- Jun 11 22:56:47 ubuntu kernel: [ 4055.733347] init: mysql main process (4123) terminated with status 7
- Jun 11 22:56:47 ubuntu kernel: [ 4055.733389] init: mysql respawning too fast, stopped
- root@ubuntu:~#
- root@ubuntu:/etc/mysql# cat /etc/mysql/my.cnf | grep -v '^#'
- [client]
- default-character-set=utf8 #这里其实不用指定的,如果要指定,要用这个指令。
- port = 3306
- socket = /var/run/mysqld/mysqld.sock
- [mysqld_safe]
- socket = /var/run/mysqld/mysqld.sock
- nice = 0
- [mysqld]
- character_set_server=utf8 #要使用这个命令,default-character-set=utf8会报错
- user = mysql
- pid-file = /var/run/mysqld/mysqld.pid
- socket = /var/run/mysqld/mysqld.sock
- port = 3306
- basedir = /usr
- datadir = /var/lib/mysql
- tmpdir = /tmp
- lc-messages-dir = /usr/share/mysql
- skip-external-locking
- bind-address = 127.0.0.1
- key_buffer = 16M
- max_allowed_packet = 16M
- thread_stack = 192K
- thread_cache_size = 8
- myisam-recover = BACKUP
- query_cache_limit = 1M
- query_cache_size = 16M
- expire_logs_days = 10
- max_binlog_size = 100M
- [mysqldump]
- quick
- quote-names
- max_allowed_packet = 16M
- [mysql]
- [isamchk]
- key_buffer = 16M
- !includedir /etc/mysql/conf.d/
- root@ubuntu:/etc/mysql#
- root@ubuntu:/etc/mysql# service mysql restart
- mysql stop/waiting
- mysql start/running, process 6981
- root@ubuntu:/etc/mysql# mysql -uroot -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 147
- Server version: 5.5.22-0ubuntu1 (Ubuntu)
- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show variables like '%char%';
- +--------------------------+----------------------------+
- | Variable_name | Value |
- +--------------------------+----------------------------+
- | character_set_client | utf8 |
- | character_set_connection | utf8 |
- | character_set_database | utf8 |
- | character_set_filesystem | binary |
- | character_set_results | utf8 |
- | character_set_server | utf8 |
- | character_set_system | utf8 |
- | character_sets_dir | /usr/share/mysql/charsets/ |
- +--------------------------+----------------------------+
- 8 rows in set (0.00 sec)
0 0
- Linux MySQL 更改字符集(程序中插入中文乱码 )
- 解决hibernate向mysql插入中文乱码问题(更改MySQL字符集)
- 解决hibernate向mysql插入中文乱码问题(更改MySQL字符集)
- MYSQL 中文乱码 字符集utf8 下插入中文
- java程序向mysql中插入数据的中文乱码
- 项目问题-解决mysql插入中文乱码以及程序中插入中文报错问题
- MySQL用C程序插入中文乱码
- 程序向mysql插入中文乱码解决办法
- linux下mysql插入中文乱码
- linux mysql 插入中文数据乱码解决
- mysql数据库中文乱码问题,修改mysql字符集(Linux Windows)
- java向MySQL中插入中文乱码
- spring框架中mysql插入中文乱码
- mysql中插入中文出现乱码
- mysql:java程序向mysql中插入数据的中文乱码
- Linux中MySQL中文乱码
- 插入MYSQL中文乱码
- mysql插入中文乱码
- matlab 统计总结
- JavaScript中鼠标event的位置(clientX,layerX,x,offsetX等)
- OJ网站leetcode
- Linux kernel panic问题解决方法
- js格式化金额
- Linux MySQL 更改字符集(程序中插入中文乱码 )
- oracle 递归查询 CONNECT BY、START WITH、CONNECT_BY_ROOT、CONNECT_BY_ISLEAF、SYS_CONNECT_BY_PATH
- 土地利用/覆盖遥感分类研究
- Android JNI Knowledge
- libSVM安装与参考资料汇总
- Android AIDL——实现机制浅析
- 发光二极管
- [LeetCode] Minimum Depth of Binary Tree
- source insight中添加.S文件