I recently went to backup a database and got the following error “#1007 – Can’t create database ‘wordpress_8’; database exists”.
I have the following line in the beginning of my sql file:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: 'wordpress_8'
--
CREATE DATABASE wordpress_8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE wordpress_8;
What do I need to change this to in order to insert the subsequent data into the existing “wordpress_8” database rather than create a new one?
Thanks!
To change which database you’re using, you use the
USEstatement. In this case,USE wordpress_8;. Then the actual data needs to be inserted into the tables usingINSERTstatements.