20165325 2017-2018-2 《Java程序設計》第七週學習總結

1、教材學習筆記

ch11

一、鏈接數據庫mysql

二、條件與排序查詢:git

  • where子語句

通常格式:select 字段 from 表名 where 條件sql

排序:用order by子語句對記錄排序數據庫

三、更新、添加與刪除操做app

  • 更新

update 表 set 字段 = 新值 where <條件子句>學習

  • 添加

insert into 表(字段列表) values (對應的具體的記錄)insert into 表 values (對應的具體的記錄)code

  • 刪除

delete from 表名 where <條件子句>blog

四、使用預處理語句排序

五、事務事務

  • setAutoCommit(booean b):方法關閉自動提交模式
  • commit():方法處理事務
  • rollback():方法處理事務失敗

2、碼雲連接

碼雲連接

3、代碼託管截圖


附:遇到的問題及部分解決方法

安裝MySQL:在執行mysqld --initialize-insecure指令時出錯

錯誤信息:

mysqld: Could not create or access the registry key needed for the MySQL application
to log to the Windows EventLog. Run the application with sufficient
privileges once to create the key, add the key manually, or turn off
logging for that application.

解決方法參考知乎:?MySQL初始化data目錄錯誤問題

總結一下:必定要用管理員的身份打開cmd,再執行mysqld --initialize-insecure指令。

如圖所示用管理員的身份打開cmd後窗口上會顯示「管理員」字樣。

注:若是以前已經以非管理員的形式執行了指令,必定要刪除原來的data文件夾,不然會出現以下錯誤信息:

[ERROR] --initialize specified but the data directory has files in it. Aborting.
相關文章
相關標籤/搜索