Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   Unknown database error (http://www.go4expert.com/forums/unknown-database-error-t20331/)

rekha 10Dec2009 12:20

Unknown database error

I have used the following code to get xml output from mysql.

>mysql -u root -X -e "select * from xxx" database_name;
But i get the following error,


ERROR:1049<42000>:unknown database 'database_name;'

venami 10Dec2009 14:53

Re: Unknown database error
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.

rekha 10Dec2009 15:13

Re: Unknown database error
Hi venami,

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


venami 10Dec2009 17:13

Re: Unknown database error
Very good :) I still remember me doing the same mistake a long time ago :D

I missed to notice it in your error statement :)

All times are GMT +5.5. The time now is 19:34.