unknown database in jdbc

前端 未结 7 1622
有刺的猬
有刺的猬 2021-01-26 00:59

I am using JDBC and new to it. but I keep getting this runtime exception:

   connecting to psysical database...
   com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErr         


        
相关标签:
7条回答
  • 2021-01-26 01:16

    Log in to the mysql server,

    $ mysql -u <username> -p<password>
    

    List all the databases,

    mysql> show databases;
    

    Check whether your DB name is there,

    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | kholofelodb        |
    | mysql              |
    | phpmyadmin         |
    +--------------------+
    

    Please note: database names are case sensitive.

    Hope this helps.

    0 讨论(0)
  • 2021-01-26 01:26

    It seems that the fault lies with the name of your database. MySQL is the database engine, but within MySQL you can have a number of databases with their own tables. Once you get the database name correct, you may find that the problem will resolve.

    0 讨论(0)
  • 2021-01-26 01:26

    yeah this case arrived to me also and actually my database name was correct but the problem is in my port number I was using WAMPP server whose port number is 3308 and i wasted my time by using 3306 so u can check that are u using any other app then first it is recommended to check the port value of it...........

    0 讨论(0)
  • 2021-01-26 01:29

    please check in mysql database whether the database name 'kholofedb' is existed or not

    i think you haven't created

    please check it once if no create it and its related tables also

    0 讨论(0)
  • I had the same issue and found that the cause of it was: The name of the database here is CASE SENSITIVE! So, I was trying to connect using a database name like "test2", but the database name actually was "Test2".

    0 讨论(0)
  • 2021-01-26 01:34

    Issue is with your database names only. First create on database in mysql* create database connection .Concentrate on these areas : database name : URL: mention database name properly that database name should be reflects database in mysql*

    0 讨论(0)
提交回复
热议问题