## Mysql自学之路##

一、mysql表和索引的创建
1:查看mysql连接数,状态,最大并发数
show variables like ‘%max_connections%’; (可以在/etc/my.cnf里面设置数据库的最大连接数)
2:创建用户,赋予权限
CREATE DATABASE ‘zabbix’ DEFAULT CHARACTER SET utf8;
grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;
3:创建表
create table tb1( id int primary key auto_increment, username varchar(6), passwd int not null );
4:创建表tb2,外键约束于tb1(id)
create table tb2( id int primary key auto_increment, username varchar(6), tid int, foreign key(tid) references tb1(id));
5:创建索引:
1):单独创建索引:create index index_name on student(name,age)
2):查看索引: show index from student;
3):删除索引: DROP index index_name on student;

二、Mysql的备份和恢复
三、Mysql慢查询日志分析
四、Mysql的索引优化
五、Mysql存储引擎优化
六、Mysql的锁机制优化
七、Mysql集群

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值