此文章做爲 mysql 問題記錄: php
1. select * from `Passport` where `PassportID`={$passportID} mysql
遭遇問題的就是這樣一條語句 ,咋一看沒錯,可是問題就出在where以前的空格上,由於在coding與同事交流,手誤輸入了全角空格,致使語法錯誤 sql
2. php 代碼: $sql = "select * from `Passport` where unix_timestamp({$date_start})>unix_timestamp({$date_end})"; 數據庫
上面的語句中,日期沒有引號引發, 並不會報錯。 在mysql中 unix_timestamp(2012-12-12) 返回的值爲0 this
3. MySQL Server Error: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file ( 2000 ) spa
4. unix
1093 - You can't specify target table 'ordercw' for update in FROM clause
不能對一張表中的數據 , 查詢出來更新或刪除 code
處理的方法是使用, 建立臨時表 , 而後在進行處理 ip
5. 根據條件導出數據庫中某種表中數據 ci
mysqldump -u root -p database --no-create-db=TRUE --no-create-info=TRUE --add-drop-table=FALSE --where="XXX" table>file_path;