1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unknown database error

Discussion in 'MySQL' started by rekha, Dec 10, 2009.

  1. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    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;'
     
  2. venami

    venami New Member

    Joined:
    Dec 26, 2008
    Messages:
    195
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    Software Professional
    Location:
    India, Tamil Nadu, Cuddalore
    Home Page:
    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.
     
  3. rekha

    rekha New Member

    Joined:
    Jan 17, 2008
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hi venami,

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


    Thanks.
     
  4. venami

    venami New Member

    Joined:
    Dec 26, 2008
    Messages:
    195
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    Software Professional
    Location:
    India, Tamil Nadu, Cuddalore
    Home Page:
    Very good :) I still remember me doing the same mistake a long time ago :D

    I missed to notice it in your error statement :)
     

Share This Page