Connect to MySQL before propagating?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crunch42
    Member
    • Feb 2005
    • 43

    #1

    Connect to MySQL before propagating?

    Does anyone know if it's possible to connect to MySQL from a PHP webpage before the DNS has propagated? I keep getting MySQL "No database selected" errors and I'm wondering if my PHP connection string hostname needs to be something other than "localhost" because the DNS hasn't propagated yet.

    Thx,
    Julian
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    As long as you're using localhost it should work fine.
    Are you sure you're selecting a database in your code?

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • Jonathan
      Senior Member
      • Mar 2004
      • 1229

      #3
      One thing to remember (and this got me when I first signed up here)
      is you need to put: cpanelusrname_dbusrname <-- in that formate.
      "How can someone be so distracted yet so focused?"
      - C

      Comment

      • crunch42
        Member
        • Feb 2005
        • 43

        #4
        Not it.

        Thanks for the ideas guys, but it's not either of those. The same exact code works fine on my local machine, and the connection string does specify username_databasename. I have a lot of other php/mysql sites on my reseller account and they all work fine, and the only difference between them and this new site I'm trying to get working is that their DNS's have propagated. Hmm...does anyone know what the absolute (unpropagated) URL is for the MySQL server instead of "localhost"? Maybe that could help?

        Comment

        • crunch42
          Member
          • Feb 2005
          • 43

          #5
          Got it.

          Figured it out. Of course it was a stupid mistake on my part. In cpanel I'd created the database, created the user, but I'd forgotten to add the user to the database. Dur.

          Thanks!

          Comment

          Working...