Results 1 to 4 of 4

Thread: 1046 - No database selected
      
   

  1. #1
    QCFcom's Avatar
    QCFcom is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Question 1046 - No database selected

    Hello to All,

    I have looked on this forum for a possible thread similar to my problem
    and I didn't find any so I'm taking the liberty to write a new one.

    The solution to my problem may be simple but I can't seem to find
    the answer so perhaps someone can help. My problem briefly stated
    is as follows:

    I uploaded a working set of "php" website files to my Blue Voda "ftp"
    account and everything is mostly working, however in the code some
    webpages are referencing an SQL basebase somewhere. I've managed
    to load some dbs into my BV mySQL and/or entered various table formats
    utilized in the code which should be valid. I've also created a valid SQL
    username and password with which to access it [from my "configure.php"
    file in the code]. The problem however is when I execute the "php" code
    [from the appropriate webpage URL] I receive an error message saying:
    "1046 - No database selected".

    I have no idea what could be wrong or where to start looking for
    answers. Does anyone have any good ideas?

    Any help would greatly be appreciated!!! Thanks in advance!!!

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,082

    Default Re: 1046 - No database selected

    Your script certainly has a configuration file (it might be something like config.php) where it stored the necessary database details that you provide during installation. If this is a commercial script, there is usually a wizard that allows you to do so. However, in some cases, this is not true, and you have to manually edit this file to edit this info. If you haven't, you can't connect to the database. Also, make sure that you have added the user to the allowed users for the specific database.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  3. #3
    QCFcom's Avatar
    QCFcom is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Question Re: 1046 - No database selected

    Thanks Nav for the quick response and thanks also for being such
    a dedicated helping resource....not just for me but all the people
    I see you help!!!! Excellent job!!!

    Now to your reply, as I indicated in the initial post I have already
    found the config file located in ".../includes/configure.php". Also
    the username & password code in that file looks something like this:

    define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
    //NEW BLUE VODA LOGON:
    define('DB_SERVER_USERNAME', 'wpp_xxx_co_qcf_xx_5');
    define('DB_SERVER_PASSWORD', 'ght_xxxxxx_45');
    define('DB_DATABASE', 'wpp_xxx_co_qcf_xxxx_7g');

    Additionally, I've also mapped the file path structure so I know where and
    how this "configure.php" file is called. I know it's being called properly
    but somehow I don't think I'm logging onto the actual database like
    I think I am. Is there some way to check if I am logged in???

    Again thanks for the help!!!

  4. #4
    QCFcom's Avatar
    QCFcom is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Thumbs up Re: 1046 - No database selected

    I finally found the answer to the "database not selected" problem
    I was having. Therefore this post is a final follow up for anyone
    who may read this thread in the future and/or for all those who
    may not be that familiar with SQL functionality.

    Firstly, "SQL is an acronym which is defined as: Structured Query
    Language. The Structured Query Language (SQL) forms the
    backbone of most modern database systems. SQL is a computer
    language [organized in table format] aimed at accessing,
    manipulating, and querying data stored in relational databases. These
    databases can be accessed either interactively via "phpMyAdmin"
    Administrator Tools [provided by Blue Voda in your "Control Panel"]
    or via software programs/scripts located in your web directory.

    Secondly, my problem manifested itself by saying "1046 error: no
    database selected" which [after some careful debugging] indeed was
    the case. After a SQL database is created [aka - "add new user"]
    table formatted data then needs to be added which in my case
    either wasn't there or what was there was corrupted. Since my
    problem was associated with migrating one website [with an
    already established SQL database] to Blue Voda, I simply
    needed to "export" all my table data out of the old server
    and "import" it back into the new BV server [via "phpMyAdmin"].
    The process is fairly painless and everything works great now.

    I hope this explanation helps someone and good luck with your
    SQL projects in the future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49