mysql的常用单词

mysql的常用单词

mysql的常用单词

table view trigger function event procedure
insert select modify unique fetch connect
delete alter reanme exists array declare
update change primary auto_increment assoc references

mysql 的聚合函数

函数 说明
count(`[disetinct all]*`)
sum(`[disetinct all]<列名>`)
max(`[disetinct all]<列名>`)
main(`[disetinct all]<列名>`)
avg(`[disetinct all]<列名>`)

docker docker-maven-plugin插件的配置

docker-maven-plugin插件的配置

第一步:打开docker远程API端口

我的是centos7系统,需要修改的文件是/usr/lib/systemd/system/docker.service 文件

1
vim /usr/lib/systemd/system/docker.service

如下是我的配置文件,需要添加的部分是在第13-17行:ExecStart=/usr/bin/dockerd的后面加上-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock,ok之后 :wq ,保存并退出。注意的是0.0.0.0,你没看错,这样配置就行,并不是自己的主机ip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker

#start add config

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

#end
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

第二步:重启docker的守护进程,重启docker

命令如下:

systemctl daemon-reload

systemctl restart docker

输入netstat -anp|grep 2375 显示docker正在监听2375端口

1
2
3
> [root@izjmd5lqoeeowpz ~]# netstat -anp|grep 2375
> tcp6 0 0 :::2375 :::* LISTEN 2577/dockerd
>

输入curl 127.0.0.1:2375/info 显示一大堆信息,证明端口已经对外开放了

1
{"ID":"5ZCY:OFMV:ZO4J:WMQ2:OW57:76PX:VSF2:YX6W:6NKU:3YK6:5WJX:P7BT","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":0,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","false"]],"SystemStatus":null,"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":false,"NFd":24,"OomKillDisable":true,"NGoroutines":44,"SystemTime":"2018-10-01T16:31:00.417378358+08:00","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"3.10.0-514.26.2.el7.x86_64","OperatingSystem":"CentOS Linux 7 (Core)","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":[],"AllowNondistributableArtifactsHostnames":[],"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":[],"Secure":true,"Official":true}},"Mirrors":[]},"NCPU":1,"MemTotal":1928933376,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"izjmd5lqoeeowpz","Labels":[],"ExperimentalBuild":false,"ServerVersion":"18.06.1-ce","ClusterStore":"","ClusterAdvertise":"","Runtimes":{"runc":{"path":"docker-runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"468a545b9edcd5932818eb9de8e72413e616e86e","Expected":"468a545b9edcd5932818eb9de8e72413e616e86e"},"RuncCommit":{"ID":"69663f0bd4b60df09991c08812a60108003fa340","Expected":"69663f0bd4b60df09991c08812a60108003fa340"},"InitCommit":{"ID":"fec3683","Expected":"fec3683"},"SecurityOptions":["name=seccomp,profile=default"]}

springboot部署到远程docker容器

springboot部署到远程docker容器.md

1. 创建一个springboot项目

start.spring.io

2. 添加插件docker-maven-plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}-${project.artifactId}</imageName>
<!--<dockerDirectory>src/main/docker</dockerDirectory>-->
<baseImage>java</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>

docker 的安装

docker 的安装

1. CentOS 7 (使用yum进行安装)

1
2
3
4
5
6
7
8
9
10
11
# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# Step 3: 更新并安装 Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务
sudo service docker start
# Seep 5: 设置开机启动
sudo systemctl enable docker

2. Ubuntu 14.04 16.04 (使用apt-get进行安装)

1
2
3
4
5
6
7
8
9
10
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装 Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

计算机二级考试的基本问题

计算机二级考试的基本问题

  1. 软件设计是将软件需求转换为软件表示的过程。

  2. 数据结构与数据库设计是软件设计的任务之一。

  3. PAD 图是软件详细设计的表示工具。

  4. 在数据流图中,对所有元素都进行了命名,所有名字的定义集中起来就构成了 数据字典

  5. 软件需求规格说明书是需求分析阶段的最后成果.软件需求规格说明书有以下几个方面的作用。

    1. 便于用户、开发人员进行理解和交流
    2. 反映出用户问题的结构可以作为软件开发工作的基础和依据
    3. 作为确认测试和验收的依据
  6. 黑盒测试不关心程序内部的逻辑,只是根据程序的功能说明来设计测试用例。在使用黑盒测试法时,手头只需要有程序功能说明就可以了。黑盒测试法分等价类划分法、边界值分析法和错误推测法

  7. 黑盒测试不关心程序内部的逻辑,只是根据程序的功能说明来设计测试用例。在使用黑盒测试法时,手头只需要有程序功能说明就可以了。黑盒测试法分等价类划分法、边界值分析法和错误推测法

  8. 白盒测试法主要有逻辑覆盖、基本路径测试等。逻辑覆盖测试包括语句覆盖、路径覆盖、判定覆盖、条件覆盖、判断条件覆盖。

  9. 从技术观点上看 。软件设计包括软件结构设计、数据设计、接口设计、过程设计

  10. 程序执行的效率与数据的存储结构、数据的逻辑结构、程序的控制结构、所处理的数据量等有关

  11. 对象之间进行通信的构造叫做消息。多态性是指同一个操作可以是不同对象的行为。对象不一定必须有继承性,。封装性是指从外面看只能看到对象的外部特征,而不知道也无须知道数据的具体结构以及实现操作。

  12. 数据库系统的特点为高共享、低冗余、独立性高、具有完整性等。

  13. 数据库设计过程主要包括需求分析、、概念结构设计、逻辑结构分析、数据库物理设计、数据库实施、数据库运行和维护阶段

  14. 二叉树中度为0的节点数等于度为2的节点数加1。

  15. 软件指的是计算机系统中与硬件相互依赖的另一部分包括程序、数据和有关的文档

  16. 开发阶段包括分析、设计和实施两类任务。其中分析、设计包括需求分析、总体设计和详细设计3个阶段,实施则包括编码和测试两个阶段

  17. 结构化方法软件需求分析工具主要有数据流图、数据字典、判定树和判定表。

  18. 软件测试主要包括单元测试、集成测试、确认测试和系统测试。

  19. 需求分析阶段的工作可概括为4个方面:

    1. 需求获取。

    2. 需求分析。

    3. 编写需求规格说明书。

    4. 需求审评。

mysql操作php的相关函数

mysql操作php的相关函数

php操作 mysql 的相关函数

php 函数 说明
mysql_connect($host,$username,$password) 连接数据库
mysql_select_db($dbname,$conn) 选择数据库
mysql_fetch_array($result,`[MYSQL_ASSOC MYSQL_NUM
mysql_fetch_assoc($result) 获取数据 key索引
mysql_fetch_row($result) 获取数据数字索引
mysql_num_rows($result,$row) 数据行数
mysql_data_seek($result) 获取指定行
mysql_query($sql) 执行sql语句
mysql_close($conn) 关闭数据库
mysql_pconnect($host,$username,$password) 长连接到数据库