utf8 error on install

Today I installed a new copy of piwik 0.5 in a new folder on my server. I used the database I was using for piwik 0.4.5 (or whatever the previous build number was) because I wanted to keep all my old data.

During install, I got this error:

Client connection to the database server is not set to UTF8 by default. This is not critical issue: Piwik should work correctly. However for consistency, it is recommended that you do one of the following:

  • in your piwik config/config.ini.php, add charset = utf8 under the [database] section of your Piwik configuration file config/config.ini.php
  • recompile libmysql --with-charset=utf8

I proceeded with the install & don’t know what to do next. I realize I can do bullet #1 above, but is piwik saying the database is encoded wrong, or just the connection? I can get around mySQL, but I don’t know all the terms. I’d like to change whatever problems there are because my auto-update stopped working before & don’t want it to happen again. Our webserver forums have indicated that databases are setup with a default swedish_ci or something. Can I just change the database to utf8? If so, do I choose utf8_bin, utf8_general_ci, or utf8_unicode_ci? Do I just change the database, or each individual table?

Is there a way to check that it has been corrected?

I’m using phpMyAdmin 2.11.9.5
The following is listed when I click the phpMyAdmin button:

Server version: 5.0.85-community

Protocol version: 10

Server: Localhost via UNIX socket

MySQL charset: UTF-8 Unicode (utf8)

MySQL connection collation: [utf8_unicode_ci in a select box]

MySQL client version: 4.1.22

Any help would be appreciated.
Thanks,
-David

php uses libmysql which has a default charset defined at compile time. This isn’t the same as the mysql client. Hence, the warning.

If you have existing data that you want to keep, then wait for the migration script, otherwise you’ll have a mix of utf8 and non-utf8 data.

[quote=vipsoft @ Dec 9 2009, 08:06 PM]php uses libmysql which has a default charset defined at compile time. This isn’t the same as the mysql client. Hence, the warning.

If you have existing data that you want to keep, then wait for the migration script, otherwise you’ll have a mix of utf8 and non-utf8 data.[/quote]

I couldn’t find the ticket concerning this problem in dev.piwik.org.

I want to make a new installation of Piwik on a shared hosting server, while using a new/empty database.
Were I get the error as mentioned by prova.

When I just install now, won’t I have any further problems? Or should I have libmysql recompiled first?
What is the preferred way to handle this?

Thanx,

For a new installation encountering this warning, the easiest route is to complete the Piwik installation. Then edit your piwik/config/config.ini.php, add charset = utf8 under the [database] section.

Hey guys, I had the same problem, a warning showed up. I just went to my shared hosting through FTP and edited the /conf/config.ini.php file and added:

charset = utf8

Is there anything else left to do? I don’t get the part about the lisb… I suppose that’s not an issue?

You’re ok now.

Recompiling your lib to default to utf-8 will avoid having to set the connection charset to utf-8 at runtime, every time a connection is made to the database.