LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   What is the reason this Mysql Error ? (https://www.linuxquestions.org/questions/linux-server-73/what-is-the-reason-this-mysql-error-731372/)

epamuk 06-08-2009 03:02 AM

What is the reason this Mysql Error ?
 
What is the reason this Mysql Error ?

[root@webserver root]# mysql -u root -p;
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4534627 to server version: 4.0.13-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT VERSION();
+-----------------+
| VERSION() |
+-----------------+
| 4.0.13-standard |
+-----------------+
1 row in set (0.05 sec)
mysql> SHOW DATABASES;
+----------------+
| Database |
+----------------+
| algoritma_DB |
| arsiv_haber |
| gecici_anket |
| hat_rehberi |
| hat_rehberi_v2 |
| mysql |
| navigator |
| test |
| vipar |
+----------------+
9 rows in set (0.06 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.05 sec)
mysql> GRANT ALL PRIVILEGES ON algoritma_DB.* TO 'algoritma_dbadmin@localhost' IDENTIFIED BY "h3F!jz?Z" WITH GRANT OPTION;
ERROR 1047: Unknown command
mysql>

Wim Sturkenboom 06-08-2009 03:54 AM

Double quotes around the password?

This is what I use (recently tested on version 5.0.37 but as far as I know it also works on 4.0.23a)
Code:

mysql> grant all privileges on *.* to 'wim'@'localhost' identified by 'my password' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

This is the example from the reference manual for v3.23, v4.0 and v4.1)
Code:

GRANT ALL ON mydb.mytbl TO 'someuser'@'somehost';
please note that user and host are treated separately (so each of them between single quotes instead of together); might be another cause of the error.


Note: check your documentation

chrism01 06-09-2009 02:20 AM

Yeah single quotes for the passwd, precisely because it allows 'funny' chars in a passwd. Also, separate sets of quotes for user and host.
IOW, what he said :)


All times are GMT -5. The time now is 10:54 PM.