Importing Database


#1

I have a WordPress database that I want to import into the DH MySQL. My panel shows the hostname as mysql.mydomain.com but since I haven’t transferred my domain yet that isn’t valid. I see the name mcgruff:dsouza in the panel, and I found the following command for importing a database form shell, but it’s telling me it can’t get to the database:
mysql -h mcgruff:dsouza -umyuser -pmypsw dbname < blog.sql
To be specific, if I just use “-h mcgruff” I get:
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘mcgruff’ (111)
and for anything else I get:
ERROR 2005 (HY000): Unknown MySQL server host
so I think mcgruff is valid.

I’ve created a new subdomain called mysql.mysubdomain.dreamhosters.com but I’m not sure how long it will take for the DNS reference to propagate, or if I even did that right. Then I added that in the panel as a MySQL hostname. So far of course using that as a hostname doesn’t work.

Any tips?
Thanks!


#2

Just use the first host name you have - mysql.mydomain.com from the shell to import your script. DH servers will alwyas reference the local DNS system first, and find the local entry for that database.

Adding a sub-domain of dreamhosters.com should take an hour or less. So that should be working very shortly for you.

No, you can’ connect to your mysql host or any other DH box by mcgruff:dsouza or other names with similiar syntax - it just doesn’t work that way. :slight_smile: you have to connect with valid domain names. forinstance you can connect to server.dreamhost.com (inserting your server name) for SSH, but that doesn’t work for many services.

Before you transfer your DNS over to DH your strategy should be to create mirrors at dreamhosters.com or connect directly with your own domain names when accessing from a DH box.

Hope that makes sense.

–Matttail
art.googlies.net - personal website


#3

As you said, mysql.mydomain.com did resolve locally from shell. Thanks!

Unfortunately, and I completely understand why, I can’t get to phpMyAdmin at that subdomain - again because my domain is hosted elsewhere until I can get everything moved here. Can anyone suggest a way to have mysql.mydomain.com resolve back here? If I ping mcgruff, I get an IP. Maybe if I try to point my DNS for that subdomain to the mcgruff IP?

Actually, I can see a phpMyAdmin server at mcgruff.dreamhost.com but it doesn’t accept any usernmame/psw that I can offer.

Maybe I’m impatient but after 1.5 hours I don’t see mysql.mysub.dreamhosters.com yet. I’ll give it another few hours.

Thanks again.


#4

This DH Wiki article on hosting a subdomain for a domain hosted elsewhere might be helpful. There is another article with similar information (a little more detailed) here. :wink:

–rlparker


#5

sorry to contradict rlparker, but I think one of these two solutions will be more helpful to you.

The thing I’d do would be to log into the Panel >Goodies > manage MySQL and add a new host name to your existing database at dreamhosters.com. something like mysql.mydomain.dreamhosters.com would work and help keep things straight.

You could also follow this Wiki article. Putting a line in your hosts file for your website and mysql server will force your computer to resolve over to DH IPs - but you won’t be able to access your ‘current’ site while that’s in your hosts file.

–Matttail
art.googlies.net - personal website


#6

There is no reason at all to be “sorry” for contradicting my post - I agree your response is better! :slight_smile:

–rlparker


#7

Actually, I have done as you guys suggest:

  • I did setup mysql.mytag.dreamhosters.com as a host in the MySQL panel. It’s now been about 15 hours and the subdomain still doesn’t resolve. I’ll recheck…
  • As far as getting mysql.mydomain.com to point to DH, I would but I don’t know where it should point. As I said, I can get to mcgruff.dreamhost.com, and while it’s not necessary I could point to that IP, but none of my user/psw info works there. If I can’t login then it doesn’t matter which URL I use to get to that page.

As an aside, there are at least two errors in the MySQL panel : There is no explanation for that mcgruff:dsouza reference, and the example they have to access mySQL from the command line is incorrect. It says “mysql -u…” and there is no -h spec for the hostname. Since mysql isn’t hosted on the web servers this is required. I hope someone at DH checks that.

Bottom line is that I still don’t have access to administer my databases. However, my WordPress database only needed some minor tweaks which I was able to do with notepad (gasp) on the .sql file. I was able to install WordPress v2.2, point it to my database, and get my blog up within a couple hours. The actual time was spent more in tweaking the PHP pages to my preferences.

So I think the question now is which user/psw do I use at mcgruff.dreamhost.com?


#8

IIRC mcgruff:dsouza refers to the server and cluster that your server is in - extra info for referencing dreamhoststatus.com. It’s odd that your dreamhosters domain isn’t working yet… It rather should be.

I think that you can’t connect log into mcgruff.drem… because that’s not serving as access to your database for something tech support might use for administration. However, I believe that if you ping mcgruff.dre… and use that IP address in your hosts file with mysql.yourdomain.com it will work.

The user/pass you’ll use to connect to your database is the one you selected or created when creating the database.

I’d contact support to see why that dreamhosters.com sub domain hasn’t gone through yet. And try using a ping to get the IP address for your hosts file.

–Matttail
art.googlies.net - personal website


#9

All mysql servers are added to /etc/hosts so yes you can access them from that webserver as if DNS had already propagated. As far as also connecting using the server/service name, IE: mcgruff:dsouza you can do that as well.

The format is servername:servicedaemon so if you saw mcgruff:dsouza you would connect using dsouza.mcgruff.dreamhost.com.
(this is only usefull if you are connecting from an external host and your domain name is not resolvable before changing DNS to DH or from another DH account in the same situation). Of course other hosts would have to be added as an allowable host for that mysql username.

Also if you know your sites IP (obtainable from Domains -> Manage DNS) by clicking the DNS link under your domain name you can access phpMyadmin by going to:

http://ipaddress/dh_phpmyadmin/mysqlhostname


#10

While it all looks great, and I do thank you for your time, I’m afraid that info doesn’t help.
dsouza.mcgruff.dreamhost.com
gets redirected to
http://www.mcgruff.dreamhost.com/dh_phpmyadmin/dsouza.mcgruff.dreamhost.com
and that page doesn’t exist. It’s obviously close but no cigar. I tried gradually trimming back everything all the way up to dh_phpmyadmin with no joy.

And while this bit of advice does lead to phpmyadmin:
http://ipaddress/dh_phpmyadmin/mysqlhostname
I am still told that the user/password I’m using is invalid.

I think I’ll have to take this through Support when I get time.

Thanks!!