zoukankan      html  css  js  c++  java
  • mysql 常用sql语句

    • 权限
    1. 撤销权限
      revoke all on *.* from 'root'@'192.168.0.197' ;

    2. 撤销权限
      revoke all on *.* from 'xx_db' @'%';
    3. 给指定用户赋予指定数据库select的权限

      grant select ON xx_db TO 'user_xx' @'%' IDENTIFIED BY "password";
      给指定用户赋予指定数据库所有的权限
      grant all privileges on xx_db.* to 'user_xxb' @'%' identified by "password";
      给所有用户赋予指定数据库所有权限
      grant select on *.* to 'xx_db' @'%' identified by "password";
      给所有用户赋予所有权限(远程访问,不限制在本机访问)
      grant all privileges on *.* to 'user_xx' @'%' identified by "password";
      赋予grant的权限
      grant all privileges on *.* to 'user_xx' @'%' WITH GRANT OPTION

      给指定用户赋予所有数据库的权限
      grant select on xx_db to 'user_xx' @'%' identified by "password";

    • 备份

               备份整库:

               mysqldump -h192.168.XX.XX -uroot -p --databases DB > DB_bak_`date +%y%m%d_%H:%M:%S`.sql

    • 对比两个数据库的表以及记录是否一致:

              select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = '_db' order by create_time desc;

  • 相关阅读:
    curl命令详解
    Linux 下 set env export declare浅浅 set和shopt命令详解--(shell定制) (转载)
    ps aux指令詳解
    smb设置参考手册 --详细参数
    Ajax
    JSON浅谈
    Date类型
    笔记本电脑不能上网的问题
    editplus 初步设置
    w10 系统升级
  • 原文地址:https://www.cnblogs.com/xiaoer/p/9309422.html
Copyright © 2011-2022 走看看