How do I fix error 1049 in MySQL?

Two options for you :

  1. Remove USE mydatabasename; in your dump, and keep using : mysql -uroot -pmypassword mydatabase
  2. Change your local database name to fit the one in your SQL dump, and use : mysql -uroot -pmypassword mydatabasename

How do I fix an unknown database in MySQL?

This type of error occurs if you select any database that does not exist in MySQL. Let us first display the error of unknown database in JDBC. To remove this type of error, just go to MySQL command line and show all database names and use the chosen one from there i.e. the database which really exist.

How do I access MySQL database from terminal?

1 Answer

  1. Make sure you have created MySQL connection correctly.
  2. Open command line from search then type cd \
  3. Once you reached the bin directory then type mysql -u yourUserName -p (apply this to connect to MySQL )

What is mysqldump error 1049?

The “MySQLdump: got error :1049 :unknown database ” triggers while performing cPanel backups. This can happen when the database does not exist in MySQL.

What is error 1049 (42000)?

ERROR 1049 (42000): Unknown database ‘mysql’ when trying to access mysql via this command: this command will access the default ‘mysql’ database, and needs to be done prior to setting or resetting the root users’ MySQL password. Depending on how MySQL was installed, it is possible that the default MySQL database was NOT created.

How to resolve MySQL error as unknown database?

Create database which gave error as Unknown database, Login to mysql shell: sudo mysql -u root -p create database db_name; Now try restoring database using .sql file, -p flag will ask for a sql user’s password once command is executed.

Why is my MySQL database not showing up in cPanel?

This error most often indicates that the related database exists in a cPanel user’s database map, but the database does not exist in MySQL. You will need to check whether the database exists within MySQL. You can accomplish this by running the following command as the root user via SSH: