mysql

本文介绍了MySQL数据库的基本操作,包括创建用户、权限设置、表结构分析及维护等,并提供了优化建议,如避免长时间锁表操作和合理使用连接。

user:

create user 'name'@'host' identified by 'passwd'

grant usage/all privileges on *.* to 'name'@'host' identified by 'passwd'

with max_queries_per_hour num max_update_per_hour num max_connections_per_hour num max_user_connections num

table structure:

select * from tableName procedure analyse();

维护:

optimize;

check;

repaire;

analyze table tableName;

原生数据:

information_schema, 具有 61个表; mysqL, 具有31个表; performance_schema,具有87个表; sys, 具有1个表, 100个视图.

show processlist;kill id;

垂直分割:列长度最好可fixed,活跃度最好一致(可使用缓存);

对于锁表度操作,最好拆分;

慎用永久连接;

insert into table2(columns..) select columns.. from table1;table2存在;

select into table2(columns..) from table1;table2不存在;

select ... into outfile 'filename'

https://blog.youkuaiyun.com/u013013553/article/details/42147573

转载于:https://www.cnblogs.com/burn19/p/9015967.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值