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;

  • 相关阅读:
    Matrix-tree 定理的一些整理
    多项式
    多项式
    vijos 1641 Vs Snowy
    noip 提高组 2010
    军训有感
    我的将军啊
    洛谷 P3302 [SDOI2013]森林
    关于线段树
    关于KMP
  • 原文地址:https://www.cnblogs.com/rogerroddick/p/2941623.html
Copyright © 2011-2022 走看看