美文网首页
mysql常用命令

mysql常用命令

作者: 李晓俊 | 来源:发表于2016-11-09 17:22 被阅读10次

用户相关

  • 登录用户:

    mysql -u root -p;
    
  • 创建用户

    //grant命令是创建MySQL的用户名和口令,均为www,并赋予操作test数据库的所有权限
    grant all privileges on test.* to 'www'@'%' identified by 'www';
    

编码相关

  • 查看当前数据库编码:

    show variables like 'character%';
    
  • 修改编码:

    mysql> set character_set_client=utf8 ;
    mysql> set character_set_connection=utf8 ;
    mysql> set character_set_database=utf8 ;
    mysql> set character_set_database=utf8 ;
    mysql> set character_set_results=utf8 ;
    mysql> set character_set_server=utf8 ;
    mysql> set character_set_system=utf8 ;

相关文章

网友评论

      本文标题:mysql常用命令

      本文链接:https://www.haomeiwen.com/subject/pfktpttx.html