SQL Database location?

martynball

New Member
Messages
60
Reaction score
0
Points
0
I cannot find a support forum, and I can't get the instant support thing to work. So. Here is my problem;

I am trying to set up an IM - Instant Messanger on my website. I have created the database and followed how to set up the install file.

PHP:
<?php
///////////////////////////////////
//          ajax im 3.4          //
//    AJAX Instant Messenger     //
//   Copyright (c) 2006-2008     //
//    http://www.ajaxim.com/     //
//   Do not remove this notice   //
///////////////////////////////////
// MySQL Database Configuration
$sql_user   = 'martynb_martynb';
$sql_pass   = '********';
$sql_host   = 'localhost';
$sql_db     = 'martynb_instantmessanger';
// This is the prefix for the ajax im MySQL tables -- this can usually be left alone.
// (If upgrading from a version < 3.1, set the prefix to '')
define('SQL_PREFIX', 'ajaxim_');
// Max buddy icon size
$maxBuddyIconSize = 100; // in KBs, set to 0 to disable uploads
?>

But when I come to install I get this error:
______________________________________________________________________________
ajax im

installing...

A MySQL error occured: (1046) No database selected

A MySQL error occured: (1046) No database selected

A MySQL error occured: (1046) No database selected

A MySQL error occured: (1046) No database selected

A MySQL error occured: (1046) No database selected

A MySQL error occured: (1046) No database selected

Unable to add the first user! This likely means there was some other issue during installation.

You have change permissions of buddyicons/


status

There was an error while installing the script! Please refer to the messages above to solve your issue.

______________________________________________________________________________

The database location is set to "localhost"
Is that right? Sorry if this is the wrong place to post this but can someone please help me. And sorry to the administrator whome I PM'ed. I just read the rule after I sent it that we shouldn't send PM's to staff.
 
Last edited by a moderator:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
*Moved to programming help, this is where you should ask about programming related issues.

I am unsure about the actual issue here, but I think that you have the correct host which should be 'localhost'.

Also please remember that you should never post scripts with passwords in them, I have commented the password to protect it.

Check that you have entered the database name and user correctly and that the user has been given the correct privilages for this database, by using the tools in Canel -> MySQL Databases.
 
Last edited:

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Are you sure the db name is martynb_instantmessanger and not martynb_instantmessenger? If it is, then check the username and password as verbsite suggested. Also, check that you entered the db info in config.php and not config-sample.php.
 

martynball

New Member
Messages
60
Reaction score
0
Points
0
I copied and pasted the info into the file, so it should all be spelled correct.

I also renamed the config-sample.php to config.php because I could not see another file called config in the directory.
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
Looks to me like that file doesn't call to mysql_select_db.
Check wether there's something like "mysql_select_db($sql_db)" in the file.
If not, add it AFTER the mysql_connect() command.
 
Top