使用 MySQL

查询

1
2
3
4
5
6
7
-- 查看表创建时间
select *
from information_schema.tables
where 1 = 1
and table_schema = 'schema'
-- and table_name = 'table'
order by create_time desc

DDL

1
2
-- 额外添加自增主键
ALTER TABLE `t_user` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

用户管理

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
-- 查看用户
select user, host from mysql.user;

-- 创建用户
create user 'root'@'%' identified by 'root';

-- 查看用户授权
show grants for 'root'@'%';

-- 授权整个数据库权限给指定用户
grant all privileges on `aneat`.* to 'aneat'@'%';

-- 授权数据库对象给指定用户
grant all privileges on `dbname`.`tablename` to 'aneat'@'host';

-- 授权用户select, insert, update, delete权限
grant select, insert, update, delete on 'nd'.* to 'bxview'@'%';

-- 撤销用户select权限
revoke select on 'nd'.* from 'bxview'@'%';

-- 撤销数据库对象给指定用户
revoke all privileges on `dbname`.`tablename` from 'aneat'@'host';

-- 刷新权限
flush privileges;

-- 修改密码
set password for 'root'@'%' = password('root');

-- 删除用户
drop user 'root'@'%';

创建数据库和用户(示例)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- 查看数据库列表
show databases;

-- 创建数据库
create database laravel5;

-- 查看用户
select user, host from mysql.user;

-- 创建用户
create user 'laravel5'@'%' identified by 'laravel5';

-- 授权整个数据库权限给指定用户
grant all privileges on `laravel5`.* to 'laravel5'@'%';

-- 刷新权限
flush privileges;

数据迁移

导出执行结果

1
2
3
4
5
-- mysqldump 导出sql,多个表使用空格隔开
mysqldump -h192.168.1.11 -uroot -proot dbname tablename --where="name = '1'" > result.sql

-- mysql 输出查询结果
mysql -h192.168.1.11 -uroot -proot dbname -e "SELECT * FROM tablename" > result.sql

导出数据库对象mysqldump方式

1
2
3
4
5
-- mysqldump 导出整个数据库包括存储过程和函数 (--routines)
mysqldump -uroot -proot -R dbname > dbname.sql

-- mysqldump 导出仅数据库结构 (--no-data, -d)
mysqldump -uroot -proot -d dbname > dbname.sql

导出数据库对象mysqlpump方式(5.7.8之后)

MySQL 5.7 mysqlpump 备份工具说明

导入

1
2
3
source path/script.sql

mysql -h192.168.1.11 -uroot -proot [--default-character-set=utf8] dbname < result.sql

更改MySQL数据库存储位置

修改my.ini属性datadir = 更改后的路径[如 D:/resource/db/mysql5.6/data/],重启服务生效

注意

  • Windows中不要使用powershell执行导出命令(或使用--result-file代替>符号)

Web 前端技术

CSS

参考


JavaScript

Basic

Framework & Library

Tools

Derivative work

Fellows

其他

Punctuation

Basic

Symbol 解释
! exclamation mark
Quotation mark
# Number sign, Pound, Hash, Octothorp
$ Dollar sign
% Percent
& Ampersand
Apostrophe
* Asterisk
, Comma
- Hyphen
en dash
em dash
horizontal bar
. Full stop, Period
/ Forward slash, Stroke, Solidus, Oblique
: Colon
; Semicolon
? Question mark
@ At sign
\ Backslash
^ caret
_ Underscore, Understrike
` Backquote
~ Tilde
Dots, Ellipsis

Pairs

Symbol 解释
“” Quotation marks
‘’
() Parentheses, Round brackets
[] Square brackets
{} Moustache brackets
<> Angle brackets

Typography

Symbol 解释
Bullet
° Degree
Per mil
Basis point
Ditto mark
Prime
ʹ Modifier letter prime
ʺ Modifier letter double prime
Double prime
Triple prime
º ª Ordinal indicator
† ‡ Dagger
¿ Inverted question mark
¡ Inverted exclamation mark
Komejirushi, Kome, Reference mark
Numero sign
Pilcrow
§ Section sign
Manicule, Index, Fist

arithmetic

Symbol 解释
+ Plus
Minus
× Multiplication
÷ Obelus
= Equals
Approximately equal to

  • ¥ YEN SIGN
  • ¥ FULLWIDTH YEN SIGN

References

Relationship

Keywords

  • Misandry, Misogyny
  • Marital, Marriage, Spouse, Homogamy, Monogamy, Polygamy
  • Wedding, Groom, Bride price, Dower, Marriage squeeze
  • Dating, Flirting, Matchmaking, Blind dating, Speed dating, Intimacy, Sugar baby
  • Puppy love, Sodomy, Pederasty
  • Woo, Intimate, Unrequited love, Platonically, Courtship
  • Chastity, Virginity, Extramarital sex, Infidelity, Adultery, Fornication, Cuckold, 在室男
  • Domestic violence, Dowry death, Abusive power and control

Subjects

Spousal age difference

Mother-in-Law Problems