[mysql使用(3)] 使用mysql的時候遇到的一些錯誤

來源:互聯網
上載者:User

標籤:

1、Err1055,出現這個問題往往是在執行sql語句時候,在最後一行會出現這個問題。

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘information_schema.PROFILING.SEQ‘ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解決方案:

在 /etc/my.cnf 檔案裡加上如下:
sql_mode=‘NO_ENGINE_SUBSTITUTION‘
然後,重啟Mysql服務就可以解決了!

 

2、ERROR2003 、開啟mysql串連工具的時候出現這個問題

"ERROR 2003: Can‘t connect to MySQL server on ‘localhost‘ (10061)"

解決方案:

      這是由於mysql服務沒有啟動的原因

      2.1、若是安裝版的mysql,在服務項裡面啟動mysql服務就可以了。

      2.2、壓縮包版的mysql,在dos視窗下進入mysql檔案的bin目錄下,敲以下命令 mysqld

如果這時候還連不上就使用以下命令

D:\develop tools\MySQL Server 5.6\bin>mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 14Server version: 5.6.24 MySQL Community Server (GPL)Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql>

 

3、Err 1248 嵌套子查詢問題

[Err] 1248 - Every derived table must have its own alias

解決方案:出現這種情況一般是由於嵌套子查詢的問題,對於mysql來說嵌套子查詢來說必須要加別名,否則就會報錯,在Oracle中就不會出現這種錯誤!!!!

 

4、Err 1241 一列對應多值問題

[Err] 1241 - Operand should contain 1 column(s)

解決方案:通常這種情況是由於,一個欄位 = 多個值的問題,這時候要用到  in  欄位就可以解決了。 

[mysql使用(3)] 使用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.