ERROR 1064 (42000): You have an error in your SQL syntax

Discussion in 'Technical' started by EckyBrazzz, Feb 7, 2018.

  1. EckyBrazzz

    EckyBrazzz Member

    Many times I had this eror with an instaltion, I want to add another user with GRANT OPTION;
    MariaDB [(none)]> SHOW GRANTS FOR CURRENT_USER;
    Code:
    MariaDB [(none)]> SHOW GRANTS FOR CURRENT_USER;
    +------------------------------------------------------------------------------------------------+
    | Grants for root@localhost                                                                            |
    +------------------------------------------------------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT [QUOTE][/QUOTE]OPTION |
    | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION              |
    --------------------------------------------------------------------------------------------------+
    
    I can normal login into she CLI of mysql but when making an new admin for example it failts

    Code:
    MariaDB [(none)]> DROP USER 'admin'@'%';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> CREATE USER 'admin'@'localhost' IDENTIFIED BY '                                                                                                     h7Ym3';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> CREATE USER 'admin'@'%' IDENTIFIED BY 'h7Ym3';                                                                                                                      Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost' WITH GRAND OPTION;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual corresponds to your MariaDB server version for the right syntax to use near 'GRAND OPTION' at line 1
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost';                                        Query OK, 0 rows affected (0.01 sec)
    
     
    Last edited: Feb 7, 2018
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    might be solved already but... looks so lonely without an answer.
    yes mariadb has some impressive options but in this case, it should be GRANT :)

    edit: did you try to hide the password with a good quantity of whitespaces in one line?
     

Share This Page