一、鏈接數據庫mysql
二、條件與排序查詢:git
通常格式: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()
:方法處理事務失敗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.