Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Move a .sql file

HammerheartHammerheart Member Posts: 1
This is probably a stupid question, but I'm a newbie about MySQL and databases.

Recently I moved my website from one hosting to other. I had some php scripts (that uses a database for storing data) installed on the old hosting server then I exported a .sql file with all the information from the databases.

Next I uploaded my site to the new hosting and tried to import the .sql file with phpMyAdmin, but doesn't work and I got an error saying that my database can't be created. I saw the error and become aware of the .sql file stills with the information of my old hosting, including database name, username, password, etc.

Is possible import it to my new hosting? or I need to put the data manually?

So much thanks in advance!

Comments

  • quotientquotient Member Posts: 62
    Greetings,

    Usually, webhosts does not allow you to create database yourself using a script or phpMyAdmin. To create a database, you may have to contact your hosting provider directly, or create one using your package control panel. Per example, I use CPanelX. I need to create a database using Cpanel first, then I can use phpMyAdmin to import SQL files.

    However, if your .sql file contains a CREATE DATABASE statement, in those cases mentionned above, import will likely fail, because any error within a SQL file will cause the server to abort it.

    Remember that on shared hosting environment (which means you do not OWN the server yourself), you can rarely create database using scripts because of two reasons: it can be a security breach, or you may have a limited number of databases.

    Cheers,

    F
Sign In or Register to comment.