I can't connect to mysql

Hello everyone,
all my code is done in my localhost (my PC). But it is don't connect to mysql in my host when I deploy in my host.
mysql in this is host using port 3307.
This is my database config.
$db['default']['hostname'] = "localhost";
$db['default']['port'] = "3307";
$db['default']['username'] = "root";
$db['default']['password'] = "xxxroot";
$db['default']['database'] = "vos_xxx";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
Some site in this host is done very well
any one help me?
Thank you so much.

Assuming your using mysql (like you've set) try connecting with the mysql command line tool to see if that works. If it doesn't connect then that's going to be the problem.

http://www.cryer.co.uk/brian/mysql/howto..._mysql.htm for info on how to do this!

Another thing what are you using WAMP, XAMMP or LAMP?


I am using Phpmyamin to create database, its is so good.

I use this test code in all my ./config/database.php files:
$link = &mysql;_connect
                    // FALSE,
                    // 128
if (!$link) {
  die('Not connected : ' . mysql_error());

// check the current db
$db_selected = mysql_select_db($db['default']['database'], $link);
if (!$db_selected) {
    die ('Can\'t use <b>' .$db['default']['database'] .'</b> : ' . mysql_error());

Still don't work now. any one helpme?

[quote author="mikevu" date="1260367864"]Still don't work now. any one helpme?[/quote]
It is not easy trying to diagnose your problem from my where I am sitting Smile

What are the error messages are generated?

It works done in my PC,port of mysql is 3306.
in my host mysql's port is 3307 --&gt; Don't connect to database.

[quote author="mikevu" date="1260371150"]It works done in my PC,port of mysql is 3306.
in my host mysql's port is 3307 --&gt; Don't connect to database.[/quote]
I have never used or needed to set the port. I have just set the database, user and password and it works everytime both on WAMP, XAMP and on quite few on-line hosts.

Have you tried without setting the port?

What error messages are returned?

I can't reset the port because there are a lot of websites are running in the Server.
The website are done very well in my PC with default port of mysql (3306).
I think it may be issue of CI

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.