zoukankan      html  css  js  c++  java
  • mysql usage

    Modify password for root user

    1. using root account to log on mysql

    mysql>set password =password(‘yourpwd’);

    mysql>flush privileges;

    2. using grant statement

    mysql>grant all on *.* to root@’localhost’ identified by ‘yourpwd’;

    mysql>flush privileges;

    3. update the user table;

    mysql>update user set password=password(‘yourpwd’) where user=’root’ and host=’localhost’;

    mysql>flush privileges;

    Add user into mysql

    using root account to log on mysql

    mysql>grant all on *.* to root@% identified by ‘yourpwd’;

    mysql>flush privileges;

    Remove user from mysql

    using root account to log on mysql

    mysql>use mysql;

    mysql>revoke all on *.* to root@localhost;  --revoke privileges assigned to this user

    mysql>delete from user where user=’root’ and host=’localhost’;

    mysql>flush privileges;

    Import sql file into mysql

    #>mysql –uroot –p < mysql.sql

    Open remote connection

    1. Check the network and port whether work well. Default port for MYSQL is 3306.

    2. Check the user@’%’ whether this account exists in user.

    use the administrator account log on mysql

    mysql>use mysql;

    mysql>select user, password, host from user;

    image 

    if the ‘%’ host doesnot exist in user. please add it by using ‘grant’ statement;

  • 相关阅读:
    ant中build.xml文件解释
    mysql练习题
    Mysql基本知识
    Python Socket 简单聊天室2
    Python Socket 简单聊天室1
    Python 导入模块
    Python 文件的处理
    Python yield
    Python 内置函数
    Python 生成验证码
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/2941623.html
Copyright © 2011-2022 走看看