Unknown database error

rekha's Avatar
Contributor
Hi,

I have used the following code to get xml output from mysql.
Code:
>mysql -u root -X -e "select * from xxx" database_name;
But i get the following error,

Code:
ERROR:1049<42000>:unknown database 'database_name;'
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
As far as the syntax is concerned, it is correct. But the above error occurs only when the database that you are trying to use "database_name" doesn't exist.

You should check whether you have specified the correct database name and then try the command again.
0
rekha's Avatar
Contributor
Hi venami,

Thanks for the reply.I got it solved by removing semicolon at the end of the statement.


Thanks.
0
venami's Avatar, Join Date: Dec 2008
Ambitious contributor
Very good I still remember me doing the same mistake a long time ago

I missed to notice it in your error statement