標籤:設定 serve 欄位 中文顯示 編碼 alt oba ide auto
1,mysql中文顯示為?解決辦法
show variables like ‘character_set_%‘;
show variables like ‘collation_%‘;
character_set_database 和 character_set_server 應該為utf8,collation_database 和 collation_server應該為utf8_general_ci.
如果不一樣需要修改/etc/my.cnf
首先關閉資料庫以及斷開資料庫服務
/etc/init.d/mysqld stop
service mysqld stop
開啟my.cnf後,在檔案內的[mysqld]下增加如下兩行設定:
charcter_set_server=utf8
init_connect=‘SET NAMES utf8‘
儲存退出
重新啟動資料庫服務
/etc/init.d/mysqld start
service mysqld start
2,
修改資料庫編碼格式
alter database <資料庫名> character set utf8;
修改資料表編碼格式
alter table <表名> character set utf8;
修改欄位編碼格式
alter table <表名> change <欄位名> <欄位名> <類型> character set utf8;
例如:alter table user change username username text character set utf8 not null;
3,
Establishing SSL connection without server‘s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn‘t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false‘. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
查看sql_mode
select @@sql_mode
去掉ONLY_FULL_GROUP_BY,重新設定值。
set GLOBAL sql_mode =‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION ‘;
4,
Error Code:1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect
set SQL_SAFE_UPDATES=0;
mysql遇到的相關問題