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;

  • 相关阅读:
    如何保证service不被系统杀死
    查找算法
    java多线程学习
    设计模式-单例
    Python2.7-内置类型
    Python2.7-内置函数
    准备要学的东西
    Python-2.7 : 编码问题及encode与decode
    【JZOJ4637】大鱼海棠【博弈论】
    【JZOJ4637】大鱼海棠【博弈论】
  • 原文地址:https://www.cnblogs.com/xiaoer/p/9309422.html
Copyright © 2011-2022 走看看