Uploading SQL Files


#1

Hello everyone, I hope you can help. I have just recently bought out my former business partner and am transfering my website to Dreamhost. I have uploaded all my files but am having trouble with the SQL database. I am not a technical person and thought this would be straight forward but it seems a little more complicated. I have 2 database files, 1 called weddingphotography_admin.sql and the other called weddingphotography.sql

The MySQL server confuses me a little as I am not sure how to set up my database or check if it is working. Also what is the hostname as I have the info for the database but it also asks to be linked to a hostname?

If anyone can help please give it to me in 5 year old format as I am not completely familiar with the system.

Regards

Andy


#2

[quote=“andwhi27, post:1, topic:55357”]
Hello everyone, I hope you can help. I have just recently bought out my former business partner and am transfering my website to Dreamhost.[/quote]

Congrats.

[quote]
I have uploaded all my files but am having trouble with the SQL database. I am not a technical person and thought this would be straight forward but it seems a little more complicated.[/quote]

Aint it always the case.

[quote]
I have 2 database files, 1 called weddingphotography_admin.sql and the other called weddingphotography.sql [/quote]

Ok, down to biz. Do you know what program or utility was used to generate those files, and if not, usually the code that creates these will put some comments at the top of the file. Post those first few lines of the file here if you’re not sure.

[quote]
The MySQL server confuses me a little[/quote]

I feel the same way about diesel engines.

[quote]
as I am not sure how to set up my database or check if it is working.[/quote]

Fortunately, DH finally decided to un-bury the database management option in the control panel and it’s now in the upper left corner under the “Toolbox”. You can do pretty much anything you need to from the “MySQL Databases” option.

The hostname is going to be mysql.yourdomain.com (provided you’re not trying to use a subdomain which I’m gonna assume not for now). With any luck no one has already used your database or user names on the server and it should be reasonably straightforward.

Also, bad luck notwithstanding, your database .sql dumps were created with the “phpmyadmin” web tool and should be relatively simple to import once you’ve created the databases.

Which leads to step 1:
Create the databases with the names in the files you have: weddingphotography_admin and weddingphotography. You will also need to have a username/password combination for each database - the same user can be assigned to both if your web application allows for it.

If you get past that, you can do the next bit and log into the “phpMyadmin” links for the respective databases to “import” the files. After that its just a matter of making things match up to those credentials in your web application (whatever that may be) and you’re online.

See how ya make out with that part.


#3

[quote=“netdcon, post:2, topic:55357”]

[quote=“andwhi27, post:1, topic:55357”]
Hello everyone, I hope you can help. I have just recently bought out my former business partner and am transfering my website to Dreamhost.[/quote]

Congrats.

[quote]
I have uploaded all my files but am having trouble with the SQL database. I am not a technical person and thought this would be straight forward but it seems a little more complicated.[/quote]

Aint it always the case.

[quote]
I have 2 database files, 1 called weddingphotography_admin.sql and the other called weddingphotography.sql [/quote]

Ok, down to biz. Do you know what program or utility was used to generate those files, and if not, usually the code that creates these will put some comments at the top of the file. Post those first few lines of the file here if you’re not sure.

Ok, the first few lines of my SQL are as follows:
– phpMyAdmin SQL Dump
– version 2.11.3
http://www.phpmyadmin.net

– Host: outof10-vm1.vm.melbourne.co.uk:3306
– Generation Time: Jun 01, 2011 at 02:56 PM
– Server version: 5.1.56
– PHP Version: 5.2.5

SET SQL_MODE=“NO_AUTO_VALUE_ON_ZERO”;


– Database: weddingphotography_admin

The hostname is going to be mysql.yourdomain.com (provided you’re not trying to use a subdomain which I’m gonna assume not for now). With any luck no one has already used your database or user names on the server and it should be reasonably straightforward.

Also, bad luck notwithstanding, your database .sql dumps were created with the “phpmyadmin” web tool and should be relatively simple to import once you’ve created the databases.

Which leads to step 1:
Create the databases with the names in the files you have: weddingphotography_admin and weddingphotography. You will also need to have a username/password combination for each database - the same user can be assigned to both if your web application allows for it.

If you get past that, you can do the next bit and log into the “phpMyadmin” links for the respective databases to “import” the files. After that its just a matter of making things match up to those credentials in your web application (whatever that may be) and you’re online.

Mmmmm… it looks like someone else has 1 of the database names ‘weddingphotography’. Can I change the database name or do I need to do this in a lot of different files as well?

I have created the host mysql.domainname.co.uk but it doesn’t do anything when I click phpMyAdmin.

I appreciate all your help please give more :slight_smile:

Andy


#4

Excellent. That should work well.

Gah. Hate when that happens, but can’t say as I’m terribly surprised. Obviously you’re going to have to rename the database. In fact, It might be better to rename both, but that’s a tough call without knowing if you’re using an application that’s conducive to switching db names.

Can’t speak to that. Most applications I’ve programmed have the database name set in a single piece of code that is distributed among all programs - hopefully that’s your case as well but “your mileage may vary”.

Now that’s a bit odd. I’m thinking it’s possibly because you haven’t created a database yet and phpMyadmin needs at least one database with its associated username/password to function (…also, make sure you have allowed dreamhost to open new windows/tabs/pop-ups in case some pop-up blocker software is stifling the process).

Add a database like “weddingphotographyiii” (where “iii” is your initials or some other unique thingamabob), get a username and password associated with it then take a whack at the phpmyadmin link.

Once you’re (hopefullly) there, across the top you’ll see a “tab” devoted to “Import” that will allow you to import the .sql file from your local machine. If ya get it, then we can see what kind of other programming machinations may be necessary.


#5

I have now renamed the database and created both on the system and still the Mysql.thisisweddingphotography.co.uk isnt working. Could it be because I havent had the domain transferred yet?

Andy


#6

If you didn’t at least update the name servers to point to dreamhost it will not work until you do. And it may take some time for the change to propagate too once you have.

I would suggest that in the meantime you add a dreamhosters sub-domain (i.e. mysite.dreamhosters.com) and make it a mirror of your domain name. That way you can work on your website accordingly using the sub-domain until you get the dns of your domain name straightened out. You would just need to remove any references to the sub-domain once the switchover is complete but at least you would be able to really work on your site.


#7

That would be one problem for sure. The nameservers for your domain are currently pointed to: ns1.melbourne.uk.net
ns2.melbourne.uk.net
At this point dreamhost can’t point Mysql.thisisweddingphotography.co.uk to the correct place.

I’ve never done it, but you can create a free dreamhosters.com sub-domain to work on your site before you change you nameservers or transfer the domain.


#8

That’ll definitely put a damper on things.

You can either set the DNS entries to the DH servers or add entries to your local hosts file for the SQL server. Since you’re a self-professed novice I’d suggest the former. You can always set it back to what it was later though it does usually take about 12-48 hrs for changes to fully propagate (tough to say for non-US sites, but sometimes mine push out in as little as 4 hours).