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;

  • 相关阅读:
    C语言01
    C++面试总结更新
    Python网络爬虫与信息提取02
    Self-Driving Car 01
    Python网络爬虫与信息提取01
    Python-03
    Shell
    Python-05
    Python-04
    Python-02
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/2941623.html
Copyright © 2011-2022 走看看