mysql-error-1007

Error importing SQL dump into MySQL: Unknown database / Can't create database

馋奶兔 提交于 2019-12-17 22:04:36
问题 I'm confused how to import a SQL dump file. I can't seem to import the database without creating the database first in MySQL. This is the error displayed when database_name has not yet been created: username = username of someone with access to the database on the original server. database_name = name of database from the original server $ mysql -u username -p -h localhost database_name < dumpfile.sql Enter password: ERROR 1049 (42000): Unknown database 'database_name' If I log into MySQL as

Error importing SQL dump into MySQL: Unknown database / Can't create database

蹲街弑〆低调 提交于 2019-11-28 15:51:22
I'm confused how to import a SQL dump file. I can't seem to import the database without creating the database first in MySQL. This is the error displayed when database_name has not yet been created: username = username of someone with access to the database on the original server. database_name = name of database from the original server $ mysql -u username -p -h localhost database_name < dumpfile.sql Enter password: ERROR 1049 (42000): Unknown database 'database_name' If I log into MySQL as root and create the database, database_name mysql -u root create database database_name; create user