+ Reply to Thread
Results 1 to 5 of 5

Thread: Database Not found after server move!?

  1. #1
    corsoconnected is offline x10Hosting Member corsoconnected is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    4

    Database Not found after server move!?

    This was working fine before the move and migration. It connects to the server even if i use 'localhost' it still connects however my PHP page the refers to this connection comes back with the die error "No database selected.". On the actual scripting where 'My Data base Name Here' it actually contains the data base name. Any ideas why its no longer working!?
    ************************************************** *************
    <?php

    $db = mysql_connect("mysql-boru.x10hosting.com", "******", "****") or die("Could not connect.");

    if(!$db)

    die("no db");


    if(!mysql_select_db("My Data Base Name Here",$db))

    die("No database selected.");

    if(!get_magic_quotes_gpc())

    {

    $_GET = array_map('mysql_real_escape_string', $_GET);

    $_POST = array_map('mysql_real_escape_string', $_POST);

    $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

    }

    else

    {

    $_GET = array_map('stripslashes', $_GET);

    $_POST = array_map('stripslashes', $_POST);

    $_COOKIE = array_map('stripslashes', $_COOKIE);

    $_GET = array_map('mysql_real_escape_string', $_GET);

    $_POST = array_map('mysql_real_escape_string', $_POST);

    $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

    }



    ?>

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Database Not found after server move!?

    The dbhost is 'localhost'

    If that does not work, leave it as 'localhost'

    Go to cPanel --> mySQL Databases
    Find the database+dbuser list.
    Click on the user for that database. On the pop-up, check "ALL PRIVILEGES" and save changes.
    Last edited by descalzo; 04-30-2010 at 11:00 PM.

  3. #3
    corsoconnected is offline x10Hosting Member corsoconnected is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    4

    Re: Database Not found after server move!?

    tried as 'localhost' and as host name set in the example all privileges are enabled still no difference. it connects but on my php that references that connection.php says no database found. i tried defining the user base name as another variable it worked but nothing in my php worked came up with every die error that i stated.

  4. #4
    vishal's Avatar
    vishal is offline -::-X10 Guru-::- vishal has a brilliant futurevishal has a brilliant future
    Join Date
    Nov 2009
    Location
    INDIA
    Posts
    5,254

    Re: Database Not found after server move!?

    What is URL that is giving you the error ?
    Regards ~ Vishal
    Giving Reputation (at bottom of my post ) is the best way to encourage the person who helped you on forums.

  5. #5
    corsoconnected is offline x10Hosting Member corsoconnected is an unknown quantity at this point
    Join Date
    Jan 2010
    Posts
    4

    Re: Database Not found after server move!?

    thanks guys i don't know if going into and resetting all privileges again or what but it seems to be working now. Thanks again, didn't work last week when i tried that lol.

+ Reply to Thread

Similar Threads

  1. Server Move
    By CWeb Creative in forum Off Topic
    Replies: 0
    Last Post: 01-30-2010, 08:23 PM
  2. Corrupt Database from move?
    By rtccc in forum Free Hosting
    Replies: 0
    Last Post: 11-25-2008, 02:50 AM
  3. Database not found.
    By elusivex in forum Free Hosting
    Replies: 3
    Last Post: 12-18-2007, 10:19 PM
  4. Database can't be found
    By NielDLR in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 09-16-2006, 10:11 AM
  5. Full Database Directory Move
    By paul_ngw in forum Free Hosting
    Replies: 4
    Last Post: 02-04-2006, 05:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers