ERROR 1049 (42000): Unknown database 'mydatabasename'

后端 未结 12 1366
故里飘歌
故里飘歌 2020-12-14 07:27

I am trying to restore database from .sql file , i have created the database in phpmyadmin and also using the create if not exist command in the .sql file which i am restori

12条回答
  •  旧时难觅i
    2020-12-14 07:53

    I found these lines in one of the .sql files

    "To connect with a manager that does not use port 3306, you must specify the port number:

    $mysqli = new mysqli('127.0.0.0.1','user','password','database','3307');
    

    or, in procedural terms:

    $mysqli = mysqli_connect('127.0.0.0.1','user','password','database','3307');"
    

    It resolved the error for me . So i will suggest must use port number while making connection to server to resolve the error 1049(unknown database).

提交回复
热议问题