Creating database on same subdomain


#1

I want to create a database, without having to create another sub-domain. I thought it was possible to have all my databases in one sub-domain.

I have an existing database that I created before the 1-domain, many-DBs policy (mysql.r8dhex.net). Now, I want to add a new DB on that same sub-domain, but the mysql panel doesn’t allow me to specify mysql.r8dhex.net.

How do I do this?


#2

Time for some juggling. I’d suggest the following:

  1. Create a new database on a new subdomain: sql.r8dhex.net
  2. Once that’s up and running, create a duplicate database of of your old DB on sql.r8dhex.net that’s empty.
  3. Do a quick dump-> restore from the old database to the new database and update your old site to use the new database.
  4. Delete your old database once you’re sure the new setup is working.

If you really want mysql.r8dhex.net back, wait a few days for DNS to clear out, then create a dummy database at mysql.r8dhex.net. It’ll be the same machine so you can update your installations to point to the new subdomain.

But, really, is it that important that both of your databases sit o the same machine? To be honest, I did the same thing just for neatness sake, but I went from specific subdomain names (wpdb.mydomain.com) to generic subdomain names (db.mydomain.com) so it was an easy migration.

-Scott


#3

Just because I feel like being technical this morning: He doesn’t necesarily need to create a dummy database. He can just add the new hostname from the MySQL panel instead, if he really wants. That is, if he still wants to use mysql.domain.com. Although, admitedly, since they’d both go to the same place I dunno why he’d want to.

Yes, I have an opinion.

Get a minimum 50% off with the “haveadreamyday” promo code, and… have a dreamy day. Original, no?


#4

If I read you right, the problem with just creating a new hostname is that it’ll most likely end up on a different database server, which won’t help him.

-Scott


#5

I probably wasn’t clear. He can cut out about 2 of your steps by just recreating his database directly on sql.domain.com then porting everything over and using that domain. Because it’s on a different server, he can have two databases with the same name. Then, once everything’s been ported over and his site uses sql.domain.com rather than mysql.domain.com, he can delete that host and its associated database. When he creates mysql.domain.com, then, assuming he wants to continue using that one, it will point to the same server as sql.domain.com. This without having to create an extra database he probably won’t use.

Yes, I have an opinion.

Get a minimum 50% off with the “haveadreamyday” promo code, and… have a dreamy day. Original, no?


#6

Sounds good to me. Especially skipping the step of a dummy database since it sounds like it’s allowable to have duplicate domain names within DreamHost as long as they’re on different servers.

-Scott


#7

So basically, there’s no avoiding creating a new subdom? Then what do they mean by having all my databases in one subdomain?

Also, how exactly will “moving my existing single-db/single-domain, to a new subdom”, help me add a new domain? Will I be able to add multiple dbs on the newly-created subdom?

Thanks


#8

Ok, I tried creating a DB with the same name on a new subdomain. It says I or someone else have already taken that DB name.

I’m not sure I understand this, I’m creating a new subdom, but the db will still be on the same machine as the old one?

What’s the point of creating a new subdom?


#9

The key to the problem you are having is that you created the db/host (subdomain) in question before the configuration change that allows you to install multiple DBs in the same subdomain or “host” instance.

I have the same situation. The only sub-domains where you can do this are ones that were created after the change. Josh talks about this on the Dreamhost Blog back in March, and further clarifies it in the comments/discussion (see the above link).

That depends on whether you move the DB from the “old” domain you created before the “many DB/one host” change to a subdomain you created after the “change”. There is more clarification and discussion of the pros and cons of all that on the blog at the link I provided.

The only point that I can see is to have both DB’s available from the same instance of phpMyAdmin and have the multiple databases on the same server. Having them on the same server can be “good” or “bad”, depending on your point of view. Again, this is discussed further, and commented on, in the blog entry I linked and the comments. I don’t mind having my databases scattered all over, and have not felt it was worth the trouble to “re-do” stuff just to get them all on the same box, or see them all from the same phpMyAdmin url. Of course, YMMV.

If you really want to “put them all on the same domain”. just Create a “new” sub-domain, export/backup the “old” database, then delete the old database. It will now be “out” of the system. Then create it “over” again, add it to the “new” sub-domain you created, and import the data that you saved from the old database. Now the databases will be on the same sub-domain. Then go change all your scripts to point to the new host as appropriate.

–rlparker


#10

Ok I understand it now. Thanks all