Help - Search - Members - Calendar
Full Version: Connect To Mysql?
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
huynm01036
I meet 2 problem with mysql:
1. It's very slow, it takes 5 minutes to connect by PHPMyadmin or other script.
2. My unique script like that:
CODE
<?php
Config::set( 'db_connection', array(
    'connection_string'=>'mysql:host=mysql.hosting.zymic.com;dbname=domainname_clanteam_database',
    'username'=>'usernamedb',
    'password'=>'passworddb',
    'prefix'=>'prefix__'
));
// $locale = 'en-us';
?>

But it doesn't work although I tested on localhost. Then I put mysql account to test on localhost, setup is ok. But can't connect!!!
I hear there are two solutions on php.net:
QUOTE
mysql:host=localhost;port=3307;dbname=testdb
or
mysql:unix_socket=/tmp/mysql.sock;dbname=testdb

But the first is not right, the second one isn't sure /tmp/mysql.sock???

Can you help me? I'm using habara cms 6.0.3
DroNix
host should be localhost. Also make sure you have entered the correct MYSQL credentials.
aftabaziz
QUOTE(DroNix @ Feb 3 2010, 10:44 PM) *
host should be localhost. Also make sure you have entered the correct MYSQL credentials.



<?php
$dbhost = 'localhost';
$dbname = 'yourwebsite_zxq_yourdatabase';
$dbuser = 'yourdatabaseuser';
$dbpass = 'yourdatabasepassword';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
?>

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.