1.安装配置

2.启动mysql服务并配置

    mysql> \s(status也行)
查看当前服务器状态
查看编码状态
Server characterset : utf8
Db characterset: utf8
Client characterset: gbk
Conn. characterset: gbk
修改:---进入配置文件my.ini
客户端:
[mysql]
default-character-set=utf8
服务端:
[mysqld]
character-set-server=utf8

查看状态和修改配置

3.登陆/退出MySql

    登陆:
常用参数:
-u, --username=name用户名(注:5.5版本去掉了--username写法)
-p, 密码
-h, --host服务器名称
-P, --port端口号
-D, --database, 打开指定数据库
--prompt=name, 设置命令提示符
--delimiter=name, 指定分隔符
-V,--version,输出版本信息并且退出
案例:
a)mysql -rroot -p
b)mysql -h127.0.0.1 -uroot -p
c)mysql -h127.0.0.1 -uroot -p --prompt=abc (只对当前连接有效)
d)mysql -uroot -proot -V

登陆

    退出:
exit
quit
\q
Ctrl + c

退出

4.Mysql常用命令:

    显示当前版本 SELECT VERSION();
显示当前日期时间 SELECT NOW();
显示当前用户 SELECT USER();
修改分隔符 DELIMITER \
开启输出日志 \T +路径
结束输出日志 \t

运维常用命令

	MYSQL语句规范:
1.关键字与函数名称全部大写
2.数据库名称,表名称,字段名称等全部小写
3.SQL语句必须以分隔符结尾
4.SQL语句支持折行操作,只要不把单词,标记或引号字符分割为两部分,可以在下一行继续写
5.数据库名称,表名称,字段名称等尽量不要使用MySQL的保留字,如果需要使用的时候
需要使用反引号('')将名称括起来

5.数据库操作:

    a)创建数据库:CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [[DEFAULT] CHARACTER SET [=] CHARSET_NAME]
CREATE DATABASE test CHARACTER SET=UTF8
b)查看当前服务器下的数据列表: SHOW {DATABASES | SCHEMA}
得到当前打开的数据库名称 : SELECT DATABASE();
c)查看上一步操作产生的警告信息: SHOW WARNINGS; d)删除指定数据库 DROP {DATABASE|SCHEMA} [IF EXISTS] db_name
案例:DROP DATABASE db_aaa1
SHOW DATABASES
e)查看指定数据库的定义 : SHOW CREATE {DATAASE|SCHEMA} db_name
f)修改指定数据库的编码方式:ALTER {DATABASE|SCHEMA} db_name [DEFAULT] CHARACTER SET[=] charset_name
g)打开指定数据库: USE db_name

创建等语句

6.Mysql中的数据类型  --具体常用的可以参考

    整数类型  --int  --TINYINT(),0为false,其余为true
浮点类型 --FLOAT 4字节
字符串类型--CHAR(M) M 个字节,<=M<= | VARCHAR(m) <=M<= L+1个字节 | ENUM('value1','value2'..)1或两个字节,取决于枚举值的个数最多65535个值
日期时间类型 time date datetime year TIMESTAEP
二进制类型 视频格式,图片路径啊等
bit[(M)]
二进制位(),m表示二进制位的长度(-),默认m= tinyint[(m)] [unsigned] [zerofill] 小整数,数据类型用于保存一些范围的整数数值范围:
有符号:
- ~ .
无符号:
~ 特别的: MySQL中无布尔值,使用tinyint()构造。 int[(m)][unsigned][zerofill] 整数,数据类型用于保存一些范围的整数数值范围:
有符号:
- ~
无符号:
~ 特别的:整数类型中的m仅用于显示,对存储范围无限制。例如: int(),当插入数据2时,select 时数据显示为: bigint[(m)][unsigned][zerofill]
大整数,数据类型用于保存一些范围的整数数值范围:
有符号:
- ~
无符号:
~ decimal[(m[,d])] [unsigned] [zerofill]
准确的小数值,m是数字总个数(负号不算),d是小数点后个数。 m最大值为65,d最大值为30。 特别的:对于精确数值计算时需要用此类型
decaimal能够存储精确值的原因在于其内部按照字符串存储。 FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]
单精度浮点数(非准确小数值),m是数字总个数,d是小数点后个数。
无符号:
-3.402823466E+38 to -1.175494351E-38, 1.175494351E-38 to 3.402823466E+38
有符号: 1.175494351E-38 to 3.402823466E+38 **** 数值越大,越不准确 **** DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]
双精度浮点数(非准确小数值),m是数字总个数,d是小数点后个数。 无符号:
-1.7976931348623157E+308 to -2.2250738585072014E-308 2.2250738585072014E-308 to 1.7976931348623157E+308
有符号: 2.2250738585072014E-308 to 1.7976931348623157E+308
**** 数值越大,越不准确 **** char (m)
char数据类型用于表示固定长度的字符串,可以包含最多达255个字符。其中m代表字符串的长度。
PS: 即使数据小于m长度,也会占用m长度
varchar(m)
varchars数据类型用于变长的字符串,可以包含最多达255个字符。其中m代表该数据类型所允许保存的字符串的最大长度,只要长度小于该最大值的字符串都可以被保存在该数据类型中。 注:虽然varchar使用起来较为灵活,但是从整个系统的性能角度来说,char数据类型的处理速度更快,有时甚至可以超出varchar处理速度的50%。因此,用户在设计数据库时应当综合考虑各方面的因素,以求达到最佳的平衡 text
text数据类型用于保存变长的大字符串,可以组多到65535 (** − )个字符。 mediumtext
A TEXT column with a maximum length of ,, (** − ) characters. longtext
A TEXT column with a maximum length of ,,, or 4GB (** − ) characters. enum
枚举类型,
An ENUM column can have a maximum of , distinct elements. (The practical limit is less than .)
示例:
CREATE TABLE shirts (
name VARCHAR(),
size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
);
INSERT INTO shirts (name, size) VALUES ('dress shirt','large'), ('t-shirt','medium'),('polo shirt','small'); set
集合类型
A SET column can have a maximum of distinct members.
示例:
CREATE TABLE myset (col SET('a', 'b', 'c', 'd'));
INSERT INTO myset (col) VALUES ('a,d'), ('d,a'), ('a,d,a'), ('a,d,d'), ('d,a,d'); DATE
YYYY-MM-DD(--/--) TIME
HH:MM:SS('-838:59:59'/'838:59:59') YEAR
YYYY(/) DATETIME YYYY-MM-DD HH:MM:SS(-- ::/-- :: Y) TIMESTAMP YYYYMMDD HHMMSS(-- ::/ 年某时)

完整版数据类型

7.(一)数据库表相关操作

a.什么是表?

         数据表是数据库最重要的组成部分之一,是其他对象的基础
数据表是存储数据的数据结构
数据表示包含了特定实体类别的数据
数据表由行(row)和列(column)构成的二维网络
数据表一定现有表结构,再有数据
数据表至少有一列,可以没有行或者多行
数据表名称要求唯一,而且不要包含特殊字符

b.如何创建数据表?

         CREATE TABLE [IF NOT EXISTS] tbl_name(字段名称 字段类型 [完整性约束条件]。。。)ENGINE=引擎名称 CHARSET='编码方式';
完整性约束条件:
1.PRIMARY KEY主键v--唯一的字段,且不能重复
2.AUTO_INCREMENT自增长
3.FOREIGN KEY 外键
4.NOT NULL 非空
5.UNIQUE KEY 唯一
6.DEFAULT默认值

c.如何查看数据库中的数据表以及表结构?

 查看数据库下的数据表: SHOW TABLES
查看指定表的表结构:
DESC tbl_name
DESCRIBE tbl_name
SHOW COLUMNS FROM tbl_name

d.创建表

案例一:创建新闻分类cms_cate 编号,分类名称,分类描述

后加:注意一个地方:create table ....(id int,caption chr注意这里写完就没有逗号了)。。。;否则报错,大爷的找了一晚上。

 CREATE TABLE IF NOT EXISTS cms_cate(
id TINYINT,
cateName VARCHAR(50),
cateDesc VARCHAR(200),
)ENGINE=MyISAM CHARSET=UTF8;

代码

案例二:
创建新闻表cms_news
编号,新闻标题,新闻内容,新闻发布时间,点击量,是否置顶,新闻所属分类,发布人

 CREATE TABLE Persons
(
Id_P int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
UNIQUE (Id_P)
);

代码一

 CREATE TABLE IF NOT EXISTS cms_testnews(
id INT PRIMARY KEY,
title VARCHAR(50) unique not null,
content TEXT not null,
pubTime INT unique not null,
isTop TINYINT(1) COMMENT '0代表不置顶,1代表置顶'
) ENGINE=InnoDB CHARSET=UTF8;

代码二

7.(二)MySQL 存储引擎

a.什么是存储引擎?

         存储引擎就是指表的类型。数据库的存储类型决定了表在计算机中的存储方式。用户可以根据不同的存储方式、是否
进行事务处理等来选择合适的存储引擎

b.如何查看MySQL的存储引擎?

         查看MySQL支持的存储引擎:       SHOW ENGINES \G;
Engine:存储引擎
Support:是否支持这种存储引擎
Comment:引擎特点
Transactions:是否支持事务处理
XA:是否是分布式的交易处理
Savepoints:是否支持保存点
查看显示支持的存储引擎信息: SHOW VARIABLES LIKE 'have%'
查看默认的存储引擎: SHOW VARIABLES LIKE 'storage_engine'

c.MySQL常用存储引擎及特点:

                             InnoDB存储引擎  --5.1版本之后
事务修改:---进入配置文件my,回滚,修复,分布式,多版本并发控制的事物安全 MyISAM存储引擎 --5.1版本之前
frm --存储表结构
myd --存储数据
myi --存储索引
MEMORY存储引擎
数据存储在内存,安全性低,速度快,生命周期短

d.如何选择合适的存储引擎?

      ---建议根据需求来选择存储引擎

完整性约束条件:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAokAAACBCAIAAAAjebcyAAAaIElEQVR4nO2dsW7kupKG77N0sOpXmGSBSXYNCBiA0fgFHFu4hpQP4HQTRTzzEJMoIjBPoUgK/BKOeqO5ASmKRRYpqt0etts/8OHAbksltnpO//qLZNW/quPhDP7nf7+ed+KVxAdvQcjxdHo9nV5Pp6EtPZiPT6PMzXw9qebvXHS9IkV1f/mNj1IUv//gTPA98K78q/gIAAAAAOBypjbDNwMAAADvBHwzAAAAcF3AN1uyZ7+64TT3wv4q+il6YqPCOTzRT/GJPSFHEvxYy/l1knXOW2jVKz03Ri3nzCO5sKn3CwAA4ALANzt0Q2IxTqu45TOqEXK0QivkSCM0al0lUUs1KllXx0bFdbFVVLZFP/HrLGohIkPyCK/VDeyRkScA+xbsc0Zq/AAAAN7Op/bNWdq2am0ttFnshknW1bFuu7o61lL1Ujny1jWOlLpe3BG5mLaJfqJ/coU/HLz3J/5gUdNrNWruhehl57yS9PFGs9exQZsBAOB9+cS+uRs2lv4TATtUjJYPbdfLTh9Wy9nL9NZCNOo0TjopLfrJyPyibUFyWMhBCju2UYom3OuS2OVCtXl5kiCsPr5V+tLpnLkjw/vcNgAAgPP51L65Slhnzhq2SuvxMKlhmsdJ9VI21fHQyl6s0rsgetlpLWyUTn2rIbhErSPo45XRuVrOQ8v44FD+GfF2oAf76fFazttib9W3VfZc+GYAAHhfPrFv3k/bNXol1+n0qmRNl0d5FryW86vqrE+tpbJ6xmqbUcrVHK9S7R4TavN6XaLlQXqcJrcbdXo9zTobH1nYJXola2OvyWCgzQAA8L58dt+cYJ1qtWjB64ZJ1q0yU9FmZbWfoNYp5UU7u975U1LbzGT2oZW98Mdg/LRz/B5tPh7sg4VJ5pvMOXksWKTaPExobRZdQ3Qd2gw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W1lVj9g9lAxSTGl+HBNwNw08A3gyJ4YuxJdYCnnWsXqZ3aTPdirdrp1e5wf92nzUs3ZXvKIsaL+vKbjz1JnqK2eLkKfDMANw18M+IXiF/pPPaS075/WPPb1dEqqLcwe/lV9JOzcmqXNq9J7IVFXImf1oW9rLju981129WLTNZyHlrHAbNFRbT9Vd1Br9AmTwnM1eGbAbhx4JtBMe4fTOERIszHmDaHq6sOVbr2SKCarfKWQztpbWt5PXlb9yYxO5QYbe4G1ZnqYLZGGNFXpr6m3c3MVA1rVbjhCr4ZgBsHvhnxC8S/XRbXK+qE7dbPE8Q9h48jJKb3p0bNg5oDxxx/hgAAfCzgmwF4N1CuCwBwFvDNiF8gPgAAgATwzQAAAMB1caW+GQAAAPi0/AcgCFWRDGMEBwAAAABJRU5ErkJggg==" alt="" />

1、给字段选择合适的类型
PRI代表主键 不能为空, 一个表中只能有一个主键

查看创建表的定义
SHOW CREATE TABLE user1;

2、AUTO_INCREMENT自增长
被标志成自增长的一定是主键,主键不一定是自增长的

CREATE TABLE IF NOT EXISTS user5(
id SMALLINT KEY AUTO_INCREMENT,
username VARCHAR()
); --)AUTO_INCREMENT=;指定起始值increment(自增长)
INSERT user5 VALUES(,'KING');

  由于是自增长,可以换种写法

INSERT user5(username) VALUES('QUEN');

 aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbsAAABmCAIAAADd3KgMAAARTElEQVR4nO2cO3IqOxCGtRlDZhbiKoqYKjbhxFXkDliDExIiElZhIjvyYpxxAs1I3a1Wq4VtjjH/V1N1D/OQNJrRN62Hb/gEAADgI/zvAgAAwNUAYwIAgBcYEwAAvMCYAADgBcYEAAAvMCYAAHiBMQEAwAuMCQAAXmBMAADwAmMCAIAXGBMAALzAmAAA4AXGBAAALzdizNfHu4eX/12I383r410goLoAUPAZ8+Uht6THUT6iiUXuHl/5+bL1GVeVeb18vjyoKfa26j5jqmUMDy/KAZEqPWG8qVh0eovarv8OPioAtHEY8/XxLrft18c7qolRaOrP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jV5jfmWX8WbkqstyZTzjJVIkw0tPWnlUW65uJvKQe/rzYrFPt1FwvUhtRBk29BvxHqu/lKWlVfdZT8S9V787bC1HlMUTX5QtAKZb179lS0vY3u2xivSLmyr8rxV1PcOWAeL8arbwjdXDgAAn59n9Pf+GDAmAAB4gTEBAMALjAl+IbWx4/6xPAC+FRgTAAC8wJgAAOAFxgQAAC//AL6+yYBkam60AAAAAElFTkSuQmCC" alt="" />

3、NOT NULL非空 --经常配合默认值使用

无符号的UNSIGEND(unsigned)
CREATE TABLE IF NOT EXISTS user7(
id INT UNSIGNED KEY AUTO_INCREMENT, 意思id是无符号的自增长的键
username VARCHAR() NOT NULL,
password CHAR() NOT NULL,
age TINYINT UNSIGNED
); INSERT user7(username, passwprd) VALUES('KING', 'KING');
INSERT user7(username, passwprd, age) VALUES('KING', 'KING', );
INSERT user7(username, passwprd) VALUES(NULL, 'KING');

实例

4.DEFAULT默认值

CREATE TABLE IF NOT EXISTS user7(
id INT UNSIGNED KEY AUTO_INCREMENT, 意思id是无符号的自增长的键
username VARCHAR() NOT NULL,
password CHAR() NOT NULL,
age TINYINT UNSIGNED DEFAULT
);

案例

5.UNIQUE KEY 唯一(一个表中只能有一个主键,但可以有多个唯一)

CREATE TABLE IF NOT EXISTS user9(
id TINYINT UNSIGNED KEY AUTO_INCREMENT,
username VARCHAR() NOT NULL UNIQUE,
card CHAR() UNIQUE
) DESC user9 ;

案例

6.外键(后面讲-配合多表查询)

外键,一个特殊的索引,只能是指定内容

可以理解为如果表A的主关键字是表B中的字段,则该字段称为表B的外键,表A称为主表,表B称为从表。外键是用来实现参照完整性的。

            creat table color(
nid int not null primary key,
name char() not null
) create table fruit(
nid int not null primary key,
smt char() null ,
color_id int not null,
constraint fk_cc foreign key (color_id) references color(nid)
)

案例

如何操作表结构

修改表名:ALTER TABLE tbl_name RENAME [TO|AS] NEW_NAME
RENAME TABLE tbl_name TO new_name 添加字段:ALTER TABLE tbl_name ADD 字段名称 字段类型【完整性约束条件】[FIRST|AFTER字段名称]
删除字段:ALTER TABLE tbl_name DROP 字段名称
修改字段属性:ALTER TABLE tbl_name MODIFY 字段名称 字段类型【完整性约束条件】【FIRST|AFTER 字段名称】
修改字段名称:ALTER TABLE tbl_name CHANGE 旧字段名称 新字段名称字段类型[完整性约束条件]【FIRST|AFTER字段名称】
添加默认值:ALTER TABLE tbl_name ALTER 字段名称SET DEFAULT默认值
删除默认值:ALTER TABLE tbl_name ALTER 字段名称 DFOP DEFAULT
添加主键:ALTER TABLE tbl_name ADD [CONSTRAINT [symbol]] PRIMARY KEY[index_type] (字段名称,...)
删除主键:ALTER TABLE tbl_name DROP PRIMARY KEY
添加唯一:ALTER TABLE tbl_name ADD [CONSTRAINT[symbol]] UNIQUE [INDEX|KEY] [索引名称](字段名称,..)
删除唯一:ALTER TABLE tbl_name DROP {INDEX|KEY} index_name
修改表的存储引擎:ALTER TABLE tbl_name ENGING=存储引擎名称
设置自增长的值:ALTER TABLE tbl_name AUTO_INCREMENT=值 .如何删除数据表
DROP TABLE[IF EXISTS] tbl_name[,tbl_name....]
CREATE TABLE IF NOT EXISTS user10(
id SMALLINT UNSIGNED KEY AUTO_INCREMENT,
username VARCHAR() NOT NULL UNIQUE,
password CHAR() NOT NULL,
email VARCHAR() NOT NULL DEFAULT '12344@qq.com', );

添加字段

以user10为例
添加card字段CHAR();
ALTER TABLE user10 ADD card CHAR();
查看表结构:DESC user10;
完整性约束条件:
ALTER TABLE user10 ADD test VARCHAR() NOT NULL UNIQUE;
ALTER TABLE user10 ADD test1 VARCHAR() NOT NULL FIRST;
ALTER TABLE user10 ADD test2 VARCHAR() NOT NULL DEFAULT AFTER username;
选中一次表,完成多个操作
ALTER GTABLE user10
ADD test4 INT NOT NULL DEFAULT AFTER password,
ADD test5 FLOAT(,) FIRST,
ADD test6 SET('A','B','C');
查看表结构:DESC user10;

案例

删除email字段

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAogAAAE3CAIAAACmXyfQAAAgAElEQ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91BNrdlqzpzVPy28vWCwXhDkBfoASeqkn1uy0Zk9rnpbfXrBYLghzAvwAJfRST6zZac2e1jwtv71gsVw8Yfa2rvJ3IQq3zBE2LLrN8QU/cLzgeC/1xJqd1uwhv888niqXn8OMOQF+gBJ6qSfW7LRmT2uelt9esFguCHMC/AAl9FJPrNlpzZ7WPC2/vWCxXBDmBPgBSuilnliz05o9rXlafnvBYrnwHjMAAIAhEGYAAABDIMwAAACG6FyY59HQCvcMn3yu0Rp8PhIAoBWRMLsvfNnveXsRZkmUD0+X+Vk7vzadq0CcAQBakJgx9yJ6X+bEJ6iXaQg96RwSfk0m4Z1fm861/OCWAAB3JyHMJb3uqlL7Firu6e6+KquQLdMQSdoyDetF3jYsRTolzRM31ayYROr3dX7ZUgm3jylUaEHK/UN5rdfOr02nLr+5KwpvCQAAFejCLMloxCpVu7RKE7mtZx/n12set4PHZHx7hexs/x5et0mnuxFbMln1hN3mMDP1pgoXBL7NDoG082vTqc/vMg3pcRLKDABwLYIwv+eFJTFKpVsOFWI77a0j8ziM47BtV7orzJmgqCTMgVIlVUO7r58BL5kzwpybZ+bS1M6vTac6v3mpLxq/AQBAMf8BS8H5mXxZaOwAAAAASUVORK5CYII=" alt="" />

ALTER TABLE user10 DROP test6;
ALTER TABLE user10 DROP test1; DESC user10; 一次删除多个字段
ALTER TABLE user10
DROP test2,
DROP test3,
....;

案例

添加test字段删除addr字段

ALTER TABLE user10
ADD test INT UNSIGNED NOT NULL DEFAULT AFTER sex,
DROP addr;

案例

修改字段属性

ALTER TABLE uer10 MODIFY email VARCHAR();--修改的是所有属性,没写的会变回默认
所以建议在改之前要先DESC tbl_name;查看一下表结构

添加默认值

CREATE TABEL IF NOT EXISTS test12(
id TINYINT UNSIGNED KEY AUTO_INCREMENT,
username VARCHAR() NOT NULL UNIQUE,
age TINYINT UNSIGNED
);
添加默认值:
ALTER TABLE user11 ALTER age SET DEFAULT ;
DESC user11;
ALTER TABLE user11 ALTER age DROP DEFAULT;
ALTER TABLE user11 ALTER username DROP DEFAULT;

案例

如何添加主键

CREATE TABLE IF NOT EXISTS test12(
id INT
);
ALTER TABLE test12 ADD PRIMARY KEY(id);

案例

CREATE TABLE IF NOT EXISTS test13(
id INT,
card CHAR(),
username VARCHAR() NOT NULL
);
ALTER TABLE test13 ADD PRIMARY KEY(id, card);

案例

删除test12表的主键

ALTER TABLE test12 DROP PRIMARY KEY;
在添加回来
ALTER TABLE test12 ADD CONSTRAINT symbol PRIMARY KEY index_type(id);

案例

----注意:

带有主键的自增长---删除
CREATE TABLE IF NOT EXISTS test14(
id INT UNSIGNED KEY AUTO_INCREMENT
); ALTER TABLE test14 DROP PRIMARY KEY; ---会报错;所以先删除自增长
所以:
ALTER TABLE test14 MODIFY id INT UNSIGNED;利用MODIFY关键字去掉了特殊属性;(就是利用修改属性,没修改的变成默认值)
ALTER TABLE test14 DROP PRIMARY KEY;

修改表的存储引擎
修改表的存储引擎为MyISAM;

ALTER TABLE user12 ENGINE=MyISAM;
修改自增长的值
ALTER TABLE user12 AUTO_INCREMENT=;

删除数据表

DROP TABLE[IF EXISTS] tbl_name[, tbl_name...]

DROP TABLE IF EXISTS user12;
SHOW WARNINGS; 查看警告
DROP TABLE IF EXISTS user1,user2,user3;

清空自增id

我们的数据库表中经常会使用id自增,但是每次清空表后id并不是从1开始计数,总是接着之前的进行自增,那么解决呢?

使用mysql的truncate命令,用法:truncate table 表名;

MySQL使用详解--根据个人学习总结的更多相关文章

  1. MySQL 操作详解

    MySQL 操作详解 一.实验简介 本节实验中学习并实践 MySQL 上创建数据库.创建表.查找信息等详细的语法及参数使用方法. 二.创建并使用数据库 1. 创建并选择数据库 使用SHOW语句找出服务 ...

  2. MySQL 数据类型 详解

    MySQL 数据类型 详解 MySQL 的数值数据类型可以大致划分为两个类别,一个是整数,另一个是浮点数或小数.许多不同的子类型对这些类别中的每一个都是可用的,每个子类型支持不同大小的数据,并且 My ...

  3. mysql存储过程详解

    mysql存储过程详解 1.      存储过程简介   我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成特定功能的S ...

  4. mysql 存储过程详解 存储过程

    mysql存储过程详解 1.      存储过程简介         我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成 ...

  5. MySQL配置文件详解

    MYSQL 配置文件详解 “全局缓存”.“线程缓存”,全局缓存是所有线程共享,线程缓存是每个线程连接上数据时创建一个线程(如果没有设置线程池),假如有200连接.那就是200个线程,如果参数设定值是1 ...

  6. MySQL存储过程详解 mysql 存储过程

    原文地址:MySQL存储过程详解  mysql 存储过程作者:王者佳暮 mysql存储过程详解 1.     存储过程简介 我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储 ...

  7. Mysql Explain 详解

    Mysql Explain 详解[强烈推荐] Mysql Explain 详解一.语法explain < table_name >例如: explain select * from t3 ...

  8. MySQL存储过程详解 mysql 存储过程(二)

    mysql存储过程详解 1.      存储过程简介 我们常用的操作数据库语言SQL语句在执行的时候需要要先编译,然后执行,而存储过程(Stored Procedure)是一组为了完成特定功能的SQL ...

  9. MySQL权限详解

    MySQL权限级别介绍 MySQL权限级别 全局性的管理权限,作用于整个MySQL实例级别 数据库级别的权限,作用于某个指定的数据库上或者所有的数据库上 数据库对象级别的权限,作用于指定的数据库对象上 ...

随机推荐

  1. Java基本语法笔记

    1. 基本格式: public class HelloWprdApp { public static void main(String[] args) {        // TODO Auto-ge ...

  2. linux curl 命令详解,以及实例

    linux curl是一个利用URL规则在命令行下工作的文件传输工具.它支持文件的上传和下载,所以是综合传输工具,但按传统,习惯称url为下载工具. 一,curl命令参数,有好多我没有用过,也不知道翻 ...

  3. ajax传输 基础一

    一个简单页面的传输 index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &quo ...

  4. JAVA Applet

  5. Linux基础整理-软件的安装与卸载

    redhat/centos/fedora/suse系列: 摘自网址:http://www.runoob.com/linux/linux-yum.html yum( Yellow dog Updater ...

  6. Hibernate整合C3P0实现连接池

    Hibernate整合C3P0实现连接池 hibernate中可以使用默认的连接池,无论功能与性能都不如C3PO(网友反映,我没有测试过),C3P0是一个开源的JDBC连接池,它实现了数据源和JNDI ...

  7. MYSQL调优

    4核8G内存配置文件 explain SQL 查看SQL索引使用情况. my.cnf skip-external-locking skip-name-resolve back_log= key_buf ...

  8. [Html5]sessionStorage和localStorage的区别

    摘要 有时需要在浏览器中保存一些数据,特别在app中嵌入的h5页面中,需要在webview中保存一些数据,作为客户端的数据持久化. h5中web storage有两种存储方式:sessionStora ...

  9. firefox的plugin-container.exe进程如何关闭?

    为什么要关闭container进程? 查看firefox所消耗的资源: ff本身: cpu一般是0-10%, 内存一般是400MB左右 plugin-container: cpu所占的比例很高, 可达 ...

  10. php 关于时区 date gmdate date_default_timezone_set/get 终极答疑

    关于GMT和UTC时间? GMT+0800 Greenwich: [gri:nitf], 格林威治/格林尼治.是英国伦敦泰晤士河附近的一个小镇 Mean: adj. 自私的; n. 平均.. he i ...