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.
相关文章
相关标签/搜索