Mysql question

Discussion in 'Server Operation' started by satimis, Sep 4, 2008.

  1. satimis

    satimis Member

    Hi folks,


    On typing following lines granting privilege;

    mysql> GRANT SELECT ON mailserver.*
    -> TO mailuser@localhost
    -> IDENTIFIED BY 'password; [Enter]
    Query OK, 0 rows affected (0.00 sec)


    I discovered later miss-typing "mailuser" as "maluser". Please advise how can I rectify it. Or how to delete that privilege and then recreate another one.



    Besides what command shall I run to show virtual users

    mysql> show virtual_user

    doesn't work.


    TIA


    B.R.
    satimis
     
    Last edited: Sep 4, 2008
  2. jon

    jon Member

  3. satimis

    satimis Member

    Hi jon,


    Thanks for your advice and link.


    Tried follows. Non of them works;
    Code:
    mysql> DROP USER maluser@localhost;
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'localhost'
    mysql> DROP USER maluser;
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'%'
    mysql> DROP USER 'maluser'@'localhost';
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'localhost'
    mysql> DROP USER maluser;
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'%'
    mysql> DROP USER maluser ;
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'%'
    mysql> DROP USER 'maluser';
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'%'
    mysql> DROP USER maluser@localhost ;
    ERROR 1396 (HY000): Operation DROP USER failed for 'maluser'@'localhost'
    
    mysql Ver 14.12 Distrib 5.0.51a,


    satimis
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Try this:
    Code:
    use mysql;
    update user set User = "mailuser" where User = "maluser";
    flush privileges;
     
  5. satimis

    satimis Member

    Hi falko,


    I got it. My problem fixed now. Thanks.


    A side question;

    If on typing;
    Code:
    mysql > line 1
          > line 2
          > line 3
          > line 4
          etc.
    
    Suddenly I found there is a typing mistake on line 2. How can I jump back to line 2 making correction? Thanks.


    B.R.
    satimis
     

Share This Page