顯示具有 MySql 標籤的文章。 顯示所有文章
顯示具有 MySql 標籤的文章。 顯示所有文章

2017年8月9日 星期三

MySQl Error: Data too long for text column


近期站台在塞資料時,
 MySQL 拋出以下錯誤:

Error Message:
Data too long for column 'xxxx' at row 1

發現要塞 80k 資料進 text 型別的欄位失敗了!
看來是跟 MSSQL 的設計不同 ( 我是從 MSSQL 遷徙過來的 )
為了得到正確的觀念,查了一下 MySQL TEXT 欄位的定義
原來 MySQL 還有對 Text 再做細分,如下:

      Type | Maximum length
-----------+-------------------------------------
  TINYTEXT |           255 (2 8−1) bytes
      TEXT |        65,535 (216−1) bytes = 64 KiB
MEDIUMTEXT |    16,777,215 (224−1) bytes = 16 MiB
  LONGTEXT | 4,294,967,295 (232−1) bytes =  4 GiB

以後要用 TEXT 欄位,還是要多注意實際情況選擇正確的型別囉!

2016年9月30日 星期五

mysql workbench Error Code: 1175


在 mysql workbench 執行 SQL 發生以下錯誤:
Error Code: 1175
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

該怎麼辦呢?

  1. 打開 mysql workbench
  2. Edit → Preferences
  3. workbench 6.0,選擇 SQL Queries 頁籤
  4. workbench 6.3,選擇 SQL Editor 頁籤
  5. 反勾選Safe Updates. Forbid UPDATEs And DELETEs with no key in WHERE clause or no LIMIT clause. Requires a reconnection
  6. workbench 重新連線
  7. 即可正常執行

2016年3月21日 星期一

Error - unable to convert runtime connection string to its design-time equivalent mysql

最近將 web site project  升級至  web application project,
開發環境從 VS2012 升級至 VS2015,

發現在更新 entity framework 的 edmx 檔的物件時發生錯誤:

執行「update model from database」



錯誤訊息: 

unable to convert runtime connection string to its design-time equivalent..


solution:
更新 the visual studio plugin 即可
請至此下載:http://dev.mysql.com/downloads/windows/visualstudio/



安裝完畢後,重啟 VS2015 即可正常更新 entity object