Welcome, Guest. [ Log In ]
Question   What hostname do I use to connect to my database?
Search KBase


Top 5 in this Area:
1. What hostname do I use to connect to my database?
2. Is there an easier way to manage my database?
3. What username/password do I use to connect to my database?
4. How do I back up my database?
5. How long does it take for a new database to start working?

 
What hostname do I use to connect to my database?
Firstly: it is NOT "localhost"!

If you don't know what the hostname for your MySQL database is, then chances are that you never set one up. We know it's silly, but at least for right now you may only have one database per hostname, and every database needs a (unique!) hostname!

Go to the Goodies::MySQL section of the webpanel

Then click on "Add MySQL Hostname" to add a hostname for your database (to use for your connections and scripts).

You'll probably want to name your hostname "mysql.yourdomain.com" but you can choose whatever name you like.

Once you set one up, you'll probably want to configure your scripts to use that value to connect to your database.

Last updated: Dec 13, 2004.

User Post (2005-05-13 12:41:54 by daprezjer)
Yes, reading fzero's post, you can't do what he says. You can't have two hosts for one MySQL database (as the initial description says). Hopefully they'll change this soon. Meanwhile, if you're trying to transfer to a new site, temporary use his option of yoursite.dreamhosters.com. Start off by creating the mysql database at yoursite.com. Then, after it's set up, click "modify" next to it and change it to yoursite.dreamhosters.com. It says that there will be 5 days of overlap where both work. So get to work! Create your site (or transfer from another site) and get it done within 5 days, then transfer the host back to yoursite.com.
User Post (2005-01-22 00:32:55 by lord_nax)
So wich port does mySQL use here?
User Post (2005-01-10 09:30:11 by creativ4)
Any one know how to get ADOdb working?
User Post (2005-01-08 11:49:25 by fzero)
Ok, take note because this one may be very useful to everyone changing from another host to DH.

As you know, you can create a fully hosted domain on DH before changing the DNS servers on your registrar. This is good on one hand, but makes the process of moving files and databases a little bit more difficult, as the domain exists on the internal DH network but points to a different IP from the rest of the internet.

So, how can you upload your database if you canīt access, say, mysql.yourdomain.com yet? And how can you see what youīve already uploaded if your domain points toa different IP? Well, what all the DH setup and welcome emails DONīT tell you is that you can ALWAYS create subdomains on dreamhosters.com free of charge to solve these problems. Take note:

1. First go to Domains::Add Domain on the panel and create a MIRROR to your fully hosted domain on a subdomain under dreamhosters.com. Letīs call it foobar.dreamhosters.com for illustration purposes.

2. After some time, foobar.dreamhosters.com will point to the web service on your fully hosted domain. Problem one solved: you can already see your site at http://foobar.dreamhosters.com before transferring the DNS permanently. This subdomain will show up just like a ĻrealĻ domain on your panel and lets you create email addresses and other sub-subdomains (like mysql hosts) under it.

3. After that you simply go to Goodies::MySQL on the panel. If you already created a database and a mysql host under your domain, click on ĻAdd hostĻ and add a host mysql.foobar.dreamhosters.com to you database. If you havenīt done this yet, create your database and the host at once. After the usual setup time, itīs possible to access phpMyAdmin through http://mysql.foobar.dreamhosters.net and do whatever you need to do with it.

When everything is in place and working, all you have to do is change the DNS record on your registrar and everything will keep working fine. You can delete you *.dreamhosters.com subdomains after that if you like (donīt forget to change the mysql configuration on your scripts!) or keep them for emergencies - nobody will take them from you and they are free after all.

This sort of thing should be included on the welcome emails - Iīm surely not the only one to move a site from one host to DH trying to make it seamlessly. Anyway, now this is at least on this forum. Hope it helps.

Oh, and kudos to Andrea from the support staff to come up with this solution!
User Post (2004-11-10 22:51:42 by gpb666)
I now use several databases under one domain, simply by naming for each database for example : mysql1.mydomain.com , mysql2.mydomain.com , mysql3.mydomain.com. It works great.
User Post (2004-05-25 11:25:30 by bigfly)
If you are concerned about having a single place to maintain all of your databases once they are created, you can still create all of the hostnames for the databases, but run phpMyAdmin at a different location, and configure it yourself to handle all of the databases. Just make sure you give users the ability to access your database from the remote location.
User Post (2003-11-02 09:40:39 by fuzzie)
Two questions: 1.) I'm running a ton of databases on several accounts here at Dreamhost. I would like to consolidate all of the databases on one account under one username, but I haven't figured out how to do that yet - any pointers? 2.) I would like to administer the creation of tables through a GUI app on my home computer, such as MySQLStudio or some similar app, but I cannot figure out how to connect to the database at DH from the local computer (can connect to localhost no prob), again, any suggestions?
User Post (2003-09-25 04:44:32 by wyzzard)
hey..........I worked it out!
Where it says "localhost", replace it with "mysql.yourdomain.com"
User Post (2003-06-07 15:26:43 by sleepyrobot)
Ben/Dimaggio -- sounds like you need to email tech support. If, as you say, the page literally says "MySQL" and nothing else, that's not normal behavior for the system. I added a database a few minutes ago, and it seems to have been set up just fine. One suggestion: the Dreamhost control panel seems to work way better using Mozilla instead of IE.
User Post (2003-05-24 21:19:08 by dimaggio)
Hi there - if anyone's listening to this thread anymore, I'd really appreciate an answer to a newbie question. I'm using an account with a set-up, working hostname and database. I want to add a second database to this hostname. From the Goodies:mySQL screen, I'm clicking "add new database". It's taking me to a really simple screen, where I type in the new db's name and just click "add". Great - no fuss, no muss. But the screen that follows gives me no indication that I have just successfully added a db - apart from the normal top and side navs, it just says "MySQL" and nothing else. I've tried this a few times over the past day, and I'm not getting any indication that a new databse is being created. All I'm seeing on the MySQL page are the usernames and the hostname associated with the previously existing database... any ideas what I'm doing wrong? Thanks! -- Ben
User Post (2003-04-10 14:47:24 by fairfield-living)
You only need to have one database host name active at any one time. Any additional databases under the same account can be accessed using the one host name. If you delete the database that has the host name associated with it, you will need to add a host name to one of the remaining databases to match the one you WERE using but just deleted. Otherwise, existing connection scripts will fail when the host name is changed or deleted.
User Post (2003-04-07 10:48:44 by exby)
Well, to answer your question in a round about way, you can have more than one database at a hostname. Now as far as dreamhost is concerned, I don't know what their policies are. But the way it works is that mysql.yourdomain.com eventually points to an ip address where the mysql daemon will be listening, usually on port 3360....or a port similar...cant remember the exact number. But additional info sent in the request is which database, the user and pass associated with it. The format depends on the programming language you are using...PHP, Perl...etc. So you can have more that ond database at an address and the mysql daemon listening on the port determines which db you use based on the the one you request as long as your login and user are valid.
User Post (2003-04-06 19:01:55 by sleepyrobot)
Is there supposed to be only one database per mysql hostname? It doesn't seem logical, but that's what the MySQL tab seems to suggest, since I can't figure out how to add a second database to my existing mysql host. In other words, do I need to create a new mysql hostname everytime I create a new database?