CodeIgniter Forums
Active Record Connect to MySQL 4.0 Database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Active Record Connect to MySQL 4.0 Database (/thread-9093.html)



Active Record Connect to MySQL 4.0 Database - El Forum - 06-11-2008

[eluser]kabbink[/eluser]
Hey guys,

I am trying to make a remote Active Record connection to an older server running MySQL 4.0.26.

The problem I am having is I keep getting the error

Quote:Unable to set client connection character set:

My connection info is as follows:

Code:
$db['npt']['hostname'] = "server.com";
$db['npt']['username'] = "remoteuser";
$db['npt']['password'] = "remotepass";
$db['npt']['database'] = "remotedb";
$db['npt']['dbdriver'] = "mysql";
$db['npt']['dbprefix'] = "";
$db['npt']['pconnect'] = TRUE;
$db['npt']['db_debug'] = TRUE;
$db['npt']['cache_on'] = FALSE;
$db['npt']['cachedir'] = "";
$db['npt']['char_set'] = "utf8";
$db['npt']['dbcollat'] = "utf8_general_ci";

I tried just not setting the char_set but then I also get a ton of errors.

Any help would be appreciated as I don't think I am going to be able to upgrade the MySQL server.

Thanks a lot for any ideas!
Kevin


Active Record Connect to MySQL 4.0 Database - El Forum - 06-11-2008

[eluser]ealonw[/eluser]
Try..........

latin1
latin1_general_ci

Mysql 4.0 by default uses latin1.. From what im reading... You might want to create a test database to check this first...


Active Record Connect to MySQL 4.0 Database - El Forum - 06-11-2008

[eluser]kabbink[/eluser]
I think the issue is that MySQL 4.0 doesnt use char_set in the same way.

I found this which fixed the problem:

http://codeigniter.com/wiki/MySQL_4.0/

Does anyone know if there is a way to apply that fix only when using a certain DB connection? My default connection works fine with the char_set variable.

Thanks!
Kevin