I am trying to open an SQL file, but unfortunately I have some problems. When I try

mysql -u -p dbname < dbsource

it says

ERROR 1049 (42000): Unknown database

The file also encrypted SHA512 and I'm not sure if that is the case or not. Need help. Thank you

  • Look if this solution can help you: askubuntu.com/a/666245/752939 – Rey Fox Nov 3 '17 at 18:37
  • Are you sure that the database is created? Can you be more clear with "open a SQL file"? what do you want do exactly? If it's a db dump file, you can open it with any text editor. Please clarify your question. – Peshmerge Nov 3 '17 at 19:07
  • As Peshmerga says, it is likely that the db does not exist. Could you try mysql -u <uid>-p <dbname> , just to make sure? – Marc Vanhoomissen Nov 6 '17 at 11:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.