Uploading MySQL Database to 000Webhost

Hi,

I have a little problem. I just downloaded my MySQL database from BlueHost, along with all the files to switch hosts. The problem is, I can’t seem to figure out a way to upload the MySQL database from the cPanal.

Can anyone assist me please?

Regards.

Hello, Zonette,

Among all the files you have, is there one that you call or name.sql.zip or name.sql.gzip or name.sql?
Do you have the file with SQL statements in order to regenerate your database?
If so, you should use from the cPanel -> phpMyAdmin

Aww yes, thanks guys! Sorry its just been so long since I’ve needed to use a host I forgot the basics :slight_smile:

Just one thing though, I remember once, when switching hosts before that I had to go into the SQL and rename all the lines with the username in them for example: “username_databasename” had to become “newusername_databasename” or something along the lines. Do I still have to do this? If so, what program would I need to use? I think I used MWord or Frontpage last time. Not to sure now.

Regards.

Hi,
I think in the file containing the data from the database (file .sql or .sql.zip or. sql.gzip) should not change anything.
Changes in server name, database name, username and password, you have to look at the files that connect to the database.
Normally in .php files (if you’re using the PHP programming language)

Hey,

I’m having a problem. I tried the steps above, but I can’t seem to be able to import the MySQL database I downloaded from BlueHost. I get the error:

Error

SQL query:

/*!40000 ALTER TABLE e107_forum_t DISABLE KEYS */;

MySQL said: Documentation
#2006 - MySQL server has gone away

Any ideas? I really need the site up and running! Please help! Thanks!

was the mysql dum done with complete/extended inserts on?

Hi, I don’t understand… I went to BlueHost cPanal > Backup and it made a full backup of all the files and databases and gave me a DL link to DL all the files in a Tz file. In this file was the databases… And thats all I know… I hope this was not the wrong way of backing up MySQL’s!

it might well be the wrong way. From what you wrote i am almost certain Complete/Extended inserts were used to create the backup. Nothing wrong with that as long as the MySQL server has a big enough timeout for the queries to complete. Now looking at your error message it seems like the the timeout isn´t big enough for the query to complete, the connection times out and you receive the error message “MySQL server has gone away”.

There are a few ways to get the database imported, but which ones might work depends on the database. You can try to manually import the database in chunks or try a tool like Bigdump, worst case would be that you have to manually turn the extended queries into single queries that then will import fine.

How big is the database btw?

Hi, thanks for the help. The size of the database is: 3.02 MB (3,168,080 bytes)

I’m sorry, but I’m really not to code savvy, so I really didn’t understand most of what you said, so I’m not quite sure what to do. Would you be able to guide me through, step by step? I’m still not sure why the server times out, its only 3MB…

Thanks!

Anyone?..

Someone please help! I’ve been trying this for days now… Someone must know a fix for it.

please, anyone…

the server times out because the database seems to have long queries in it like (an example)

INSERT INTO `table` (`id`, `name`) VALUES
(1, 'Bob'),
(2, 'Brad'),
(3, 'Ben');

To prevent it from timing out the query structure should be changed to

INSERT INTO `table` (`id`, `name`) VALUES(1, 'Bob');
INSERT INTO `table` (`id`, `name`) VALUES(2, 'Brad');
INSERT INTO `table` (`id`, `name`) VALUES(3, 'Ben');

This way the import might work. Seeing that the database is 3MB it´ll be a lot of work to change the queries, but i can´t think of another way. You could also try using tools like MySQLDumper or Bigdump to import the database but i am almost sure that they will also timeout

Thanks, but I give up… I even tried to upload a fresh copy of the CMS and start a new MySQL which worked but 000webhost blocked me from installing it becuase it wouldn’t allow the installtion to write into the _config.php file…

that´s probably because the file had no write permissions. You should change permissions for that file to 0666 or 0777 and then try installing the script again