SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access to MySQL Database on Bluehost

    I created a beautiful site(as much as a developer's first database-driven site can be), and I purchased hosting through Bluehost, I moved all my files over to BlueHost, and then when I go to my site (www.mcquistonator.com/coffeejoint), it gives me:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home7/mcquist1/public_html/coffeejoint/includes/connection.php on line 3
    Database connection failed: Access denied for user 'root'@'localhost' (using password: YES)

    I'm guessing that this is something that can be fixed quite easily. But I think it also points to a concept I'm still in the dark on. I figured out how to install WAMP, and set up my database through PHP MyAdmin, and then write the PHP code to talk to the DB when it was all being stored and accessed from my pc. But now that I'm going "live" on the web, when I transfer all my files, how does the data in the database get there? I don't have any files with that data, or I guess they are not in with all the HTML, PHP, and CSS files.

    I looked back thru my sitepoint book "building a database driven website" and I'm not finding any obvious section that tells me how to set up the "online" database.

    What big, obvious thing am I missing?
    Last edited by Matt Mickiewicz; Jul 6, 2012 at 11:07.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,333
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    You need to go back into PHPMyAdmin and save a copy of your database and upload it to your web server, probably through a similar interface that has something like PHPMyAdmin. What kind of control panel does Bluehost have? The database also needs to set up on the live server, just like you did it through WAMP.

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Also, because you wont have access to root@localhost on your hosted server's mySQL, you'll need to tweak your database connection string in your PHP files to whatever username and password you set up in your host's control panel.

  4. #4
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Many hosts show you a sample connection string, based on a database name, user name and password, so you can then adapt your own names to match, as part of their help / support.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •