Mysql database hostname

skarecx1

New Member
Messages
1
Reaction score
0
Points
0
Hello all

please forgive if this is in the wrong category, but i think it should be ok.

So, please have a look at the code below:

" private function __construct()
{
$dsn = 'mysql.x10hosting.com://skarecx1_root:password@localhost/skarecx1_rss';
$this->_handle =& DB::Connect( $dsn, array() );
}
"

this function is pasted in a PHP file called rss_db, which is uploaded to the public_html folder. There's more code included in the file, but im not going to paste that here.

I have also created a database called skarecx1_rss (just _rss basically, but by default it adds skarecx1.

The database is skarecx1_rss the user is skarecx1_root. As i have two mysql databases running on skarecx1, i guess i need to specify that i want to use the _rss database after localhost?

So to my problem, how am i suppose to put in my credentials in the code? Is there any kind of template im not aware of?

i have tried with several different options, mysql://skarecx1_root:password@localhost_skarecx1_rss etc etc.. i cant get it to work.

Someone got any inputs on this issue?

Thanks in advance.
 

nuwanpra

New Member
Messages
45
Reaction score
2
Points
0
Normally this is the way you do this in your config.php file. Hope this will help.

Code:
// ** MySQL settings - You can get this info from your web host ** //

/** The name of the database for WordPress */

define('DB_NAME', 'your_DBNAME');


/** MySQL database username */

define('DB_USER', ''your_DBUSER');


/** MySQL database password */

define('DB_PASSWORD', ''your_DBPWD');


/** MySQL hostname */

define('DB_HOST', 'localhost');
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
The MySQL connection information is outlined in an X10 wiki article. As for the appropriate DSN format, we can't say since you didn't specify what DB module you're using. In any case, check the documentation.

nuwanpra, that's merely a convention employed by some packages, a convention skarecx1's code clearly doesn't follow.
 
Top