Adding a second database


#1

Is there any way I can add a second database under the same host/username?


#2

As I was told, it has to be unique.


#3

Nope, not that I know of. While it might seem to be problematic, it is really easy enough to just create a second host/username pair, as in:

1st DB
host: whatever.yourdomain.com
user: username

2nd DB
host: whatever2.yourdomain.com
user: username2

etc.

using the same prefixes or suffixes on the “whatever” and the username makes it easy to remeber.

–rlparker


#4

well they advertise unlimted, you should beable to have more than one per hostname atleast, thats what many of my friends tell me, it should beable to be done from phpmyadmin


#5

phpmyadmin has the ability, but Dreamhost doesn’t allow it. You can try and create a new database through phpmyadmin, and you’ll get a permission denied error.

You can have unlinmited databases, you just have to create new hostnames for each one.

-Matttail


#6

dns can take forever, if you need to set up a new forum for someone or something quickly or some such situation like that it doesnt always work out, at one time I had to wait a full week before the dns finaly went through, that was for a school project too


#7

when you create a new database you’re only adding a new entry to the Dreamhost DNS system - not something that needs to propigate. I’ve been adding new database on and off for a while now, and rescently the host name has been active in 3 min or less. A while ago it owuld tak upwords of tw hours, but never more than that.

The DNS for domain.com or Anything.domain.com is allready forwarded to DH’s name server when you first update the DNS. That change can take up to 36 hours to happen. But after that, it’s quick and easy to add in sub-domains and mysql host names.

-Matttail


#8

My question is why?

Why cant I host a bunch of DBs under a single subdomain?

What is the official DreamHost reason?

I know it is easy enough to create a bunch of random (and unique) databases and sub-domain names, but it just seems like a pain to manage. For each database I have to login to a different host? that just doesn’t seem to make sence to me.


#9

Perhaps a better question is why do you need a bunch of databases? There is no practical limit to the number of tables you have per database, so why do you need more than one database?


Simon Jessey
Keystone Websites | si-blog


#10

well for one, organization: Different DBs represent differnt logical sets of data much better than tables 1,2,&3 are for system A and tables 4,5,&6 are for system B. I know that your return argument is that you can prepend some unique identifyer on the table names, but that to me seem like a hack that you would apply only if you HAD to use only 1 database. I don’t really like the idea of managing a DB with hundreds of tables all for different apps.

Another reason is for DB migrations: it is much nicer to Dump and entire DB shcema (with drop and create database scripts included) when you have your databases separated.

Yet another reason is security and security management: It is much easier to give user A rights to database A and user B rights to database B than to give user A rights to tables 1,2,& 3 and user B rights to tables 4,5,& 6. also how do you say user A can create a new table but it cant be named with the prefix given to user B’s tables.

Basically it is much easier to manage separate DB’s, My question is why do they necessarily have to be under separeate hosts?


#11

I don’t know the answer to that question. Did you try asking support that question?

Generally, you will only find other users here, and DH support personnel would be a more likely place to get an answer to your question.

–rlparker


#12

It’s my guess that the reason you can only create one DB had to do with database tracking. If you you were only allowed 10 database on your plan, it’s easier for DH to track this number and limit the amount allowed? Perhaps also for keeping track of database size?

don’t know, just making guesses.

-Matttail


#13

We currently force a separate dns hostname per database because the different databases are likely to be hosted on different back-end mysql servers and are likely to be moved around behind the scenes without notification. Maintaining a unique hostname for each database ensures that this system works transparently.

This is a common complaint, however, and we will be changing our mysql setup system at some point down the road to address this issue.

  • Dallas
  • DreamHost Head Honcho/Founder