打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
MySQL常见指令
1、查看查询缓存设置情况;
    show status like 'qcahce%';
 
2、查看最大连接数;
     show variables like 'max_connections';
 
3、过去的最大连接数;
    
 
4、查看慢查询配置;
    show variables like 'slow%';
 
5、open table情况;
    show global status like 'open%tables%';
    open_tables表示打开表的数量,opened_tables表示打开过的表数量;
    
6、超级用户登录;
    mysql -h host -u user -p
    在提示下输入超级用户密码,默认超级用户登录只能在安装数据库的主机,不能远程登录;
 
7、查看数据库列表;
    show databases;(必须是超级用户)
    create database jiradb character set ‘UTF8′;
 
8、查看用户;
    select host,user from mysql.user;(必须是超级用户)
 
9、创建用户并授权;
        create user jirauser identified by ‘jira’;
        grant all privileges on *.* to ‘jirauser’@'%’ identified by ‘jira’ with grant option;
        grant all privileges on *.* to ‘jirauser’@'localhost’ identified by ‘jira’ with grant option;
        flush privileges;
 
10、设置和修改变量
    select @@variable;
    set GLOBAL variable=value;
 
11、复制表数据
    select a,b,c from oldtable into outfile 'a.txt';
      load data INFILE 'a.txt' into table newtable (a,b,c ) ;
 
12、锁住所有的表
      FLUSH TABLES WITH READ LOCK;
      UNLOCK TABLES;
13、
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
查看MySQL的运行状态
MySQL性能分析工具profile使用教程
windows 启用mysql日志
mysql root用户看不到mysql库下的所有表
MySQL 資料庫
mysql登录错误:'Access denied for user 'root'@'localhost'
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服