mysql遇到的相關問題

來源:互聯網
上載者:User

標籤:設定   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遇到的相關問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.