zoukankan      html  css  js  c++  java
  • mysql 创建与授权

    set global read_only=0;
    set global optimizer_switch='derived_merge=off'; 
    create user 'my_user'@'%' identified by 'my_password';
    create database my_db DEFAULT CHARSET 'utf8' COLLATE 'utf8_unicode_ci';   
    
    只授权这个数据库
    grant all privileges on my_db.* to 'my_user'@'%' identified by 'my_password';
    
    授权root
    grant all privileges on *.* to 'root'@'%' identified by '123456';
    
    授权root 并附带可授权
    grant all privileges on *.* to 'root'@'%' identified by '123456' WITH GRANT OPTION;
    
    flush privileges;
    如果遇到 ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes. 错误
    
      a)打开 my.ini 给 [mysqld] 增加如下配置:
    
    innodb_large_prefix = ON
    innodb_file_format = Barracuda
    innodb_file_per_table = ON
    
      b)并修改报错的建表语句后面加上:ENGINE=InnoDB row_format=DYNAMIC;
    
    # 若没有修改my.ini的权限也可以使用命令查看参数和设置参数:
    show global variables like "innodb_large_prefix";
    show global variables like "innodb_file_format";
    show global variables like "innodb_file_per_table";
    set global innodb_large_prefix=ON;
    set global innodb_file_format=Barracuda;
    set global innodb_file_per_table=ON;

    如果遇到ERROR1709(HY000):Indexcolumnsizetoolarge.Themaximumcolumnsizeis767bytes.错误a)打开my.ini[mysqld]增加如下配置:innodb_large_prefix=ONinnodb_file_format=Barracudainnodb_file_per_table=ONb)并修改报错的建表语句后面加上:ENGINE=InnoDB row_format=DYNAMIC;# 若没有修改my.ini的权限也可以使用命令查看参数和设置参数: showglobalvariableslike"innodb_large_prefix"; showglobalvariableslike"innodb_file_format"; showglobalvariableslike"innodb_file_per_table"; setglobalinnodb_large_prefix=ON;setglobalinnodb_file_format=Barracuda;setglobalinnodb_file_per_table=ON;

  • 相关阅读:
    无题..
    让Windows 2003 Server支持ASP程序
    下雪
    比较经典的.NET基础
    XML几种操作
    某年某月有几天
    .NET操作Word(傻瓜型)
    XML 简单操作
    一首歌
    ASP.NET:掌握Web窗体的生命周期与状态管理(摘自网络)
  • 原文地址:https://www.cnblogs.com/ilovecpp/p/12842285.html
Copyright © 2011-2022 走看看