Importing database

when you wan tto upload a database form backup, do you need to first delete the current version from your hosting? and then you create a blank one with same name and import into the blank one? or, you do nothing and you can just import by giving a new name to database and it will create a new database automatically while you import?

if you are talking about a sql file then you could open it in a editor and if you find the following sentences than you can edit the database name or just remove both lines in case you would like to import the file in an existing database. choose the character set that you like.

CREATE DATABASE IF NOT EXISTS `my_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE `my_db`;

If the lines are not in the file and you would like to add them then paste them just above the first CREATE TABLE lines

The safest way is to drop the database and have it recreated from the script.

Sponsor our Newsletter | Privacy Policy | Terms of Service