Forums | Mahara Community

Support /
Problems with the DB


anonymous profile picture
Account deleted
Posts: 11

29 August 2009, 14:19

Hi! I'm installing mahara 1.1.6 with a MySQL database and I get this error "You are not using a UTF-8 database. Mahara stores all data as UTF-8 internally. Please drop and re-create your database using UTF-8 encoding.".

I have checked the database and it is using UTF-8, could be something about the version? I have upgraded to mahara 1.1.6 in my computer and it's all ok (with MySQL too) and I had the 1.1.2 previously in the server and all was ok (I had a problem upgrading, and now I'm installing), I re-create the DB but it's the same.

I tried to explain the problem the best I can, sorry for my english!

anonymous profile picture
Account deleted
Posts: 1643

30 August 2009, 19:54

Hi - could you please follow the steps that Dirk followed in this thread?: http://mahara.org/interaction/forum/topic.php?id=971

It would be interesting to see what the server is reporting the database encoding as. 

Only new installations are checked for utf8ness. We don't intend on locking people out of their installations if they upgrade to 1.1.6 or beyond. Which is why you can upgrade OK. 

anonymous profile picture
Account deleted
Posts: 11

03 September 2009, 12:49

Hi and thanks for the help, I tried with that script but something wrong happend.I put it down:

Warning: Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 43

Warning: Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 44
ERROR - something bad happened after headers have been sent. Check the error log for more information.


And watching at the error log of the server:

[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * require("/home/userName/public_html/init.php") at /home/userName/public_html/prueba.php:5
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * ensure_install_sanity() at /home/userName/public_html/init.php:257
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * require("/home/userName/public_html/init.php") at /home/userName/public_html/prueba.php:5
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * header("Content-type: text/html; charset=UTF-8") at /home/userName/public_html/init.php:223
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * error(2, "Cannot modify header information - headers already...", "/home/userName/public_html/init.php", 223, array(size 105)) at Unknown:0
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX]   * log_message("Cannot modify header information - headers already...", 8, true, true, "/home/userName/public_html/init.php", 223) at /home/userName/public_html/lib/errors.php:378
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX] [WAR] 4f (init.php:223) Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2)
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 44
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 43
[Thu Sep 03 19:32:31 2009] [error] [client 88.11.XX.XX] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/userName/public_html/prueba.php:2) in /home/userName/public_html/init.php on line 42

To create a database in the server I have to use something like an assistant which doesn't let me choose the encoding, It should be utf8 because after creating the DB I can choose other encodings  and it's always utf8 by default, maybe I should ask to the staff ofthe server.

Any other ideas? thanks for the support!!

 

anonymous profile picture
Account deleted
Posts: 1643

03 September 2009, 16:33

Hi - that seems like you have a blank line near the top of "preueba.php", that has caused HTTP headers to be sent before init.php tries to send them. If you remove that line, that should prevent all those warnings.
anonymous profile picture
Account deleted
Posts: 11

04 September 2009, 4:29

Ok I put a 1.1.2 version with the same DB and I run the script properly, sorry for that mistake, this is the result:

[DBG] 40 (test.php:8) ADORecordSet_mysql Object
(
    [databaseType] => mysql
    [canSeek] => 1
    [dataProvider] => native
    [fields] => Array
        (
            [Variable_name] => character_set_database
            [Value] => latin1
        )

    [blobSize] => 100
    [sql] => SHOW VARIABLES LIKE 'character_set_database'
    [EOF] =>
    [emptyTimeStamp] =>  
    [emptyDate] =>  
    [debug] =>
    [timeCreated] => 0
    [bind] =>
    [fetchMode] => 1
    [connection] => ADODB_mysql Object
        (
            [databaseType] => mysql
            [dataProvider] => mysql
            [hasInsertID] => 1
            [hasAffectedRows] => 1
            [metaTablesSQL] => SHOW TABLES
            [metaColumnsSQL] => SHOW COLUMNS FROM `%s`
            [fmtTimeStamp] => 'Y-m-d H:i:s'
            [hasLimit] => 1
            [hasMoveFirst] => 1
            [hasGenID] => 1
            [isoDates] => 1
            [sysDate] => CURDATE()
            [sysTimeStamp] => NOW()
            [hasTransactions] =>
            [forceNewConnect] =>
            [poorAffectedRows] => 1
            [clientFlags] => 0
            [substr] => substring
            [nameQuote] => `
            [compat323] =>
            [_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);
            [_genSeqSQL] => create table %s (id int not null)
            [_genSeq2SQL] => insert into %s values (%s)
            [_dropSeqSQL] => drop table %s
            [database] => s03f71ae_maharaBD
            [host] => localhost
            [user] => s03f71ae_prueba
            [password] => *******
            [debug] =>
            [maxblobsize] => 262144
            [concat_operator] => +
            [length] => length
            [random] => rand()
            [upperCase] => upper
            [fmtDate] => 'Y-m-d'
            [true] => 1
            [false] => 0
            [replaceQuote] => \'
            [charSet] =>
            [metaDatabasesSQL] =>
            [uniqueOrderBy] =>
            [emptyDate] =>  
            [emptyTimeStamp] =>  
            [lastInsID] =>
            [hasTop] =>
            [readOnly] =>
            [genID] => 0
            [raiseErrorFn] => adodb_throw
            [cacheSecs] => 3600
            [memCache] =>
            [memCacheHost] =>
            [memCachePort] => 11211
            [memCacheCompress] =>
            [arrayClass] => ADORecordSet_array
            [noNullStrings] =>
            [numCacheHits] => 0
            [numCacheMisses] => 0
            [pageExecuteCountRows] => 1
            [uniqueSort] =>
            [leftOuter] =>
            [rightOuter] =>
            [ansiOuter] =>
            [autoRollback] =>
            [fnExecute] =>
            [fnCacheExecute] =>
            [blobEncodeType] =>
            [rsPrefix] => ADORecordSet_
            [autoCommit] => 1
            [transOff] => 0
            [transCnt] => 0
            [fetchMode] => 2
            [_oldRaiseFn] =>
            [_transOK] =>
            [_connectionID] => Resource id #19
            [_errorMsg] =>
            [_errorCode] =>
            [_queryID] => Resource id #33
            [_isPersistentConnection] =>
            [_bindInputArray] =>
            [_evalAll] =>
            [_affected] =>
            [_logsql] =>
            [_transmode] =>
            [databaseName] => s03f71ae_maharaBD
        )

    [_numOfRows] => 1
    [_numOfFields] => 2
    [_queryID] => Resource id #33
    [_currentRow] => 0
    [_closed] =>
    [_inited] => 1
    [_obj] =>
    [_names] =>
    [_currentPage] => -1
    [_atFirstPage] =>
    [_atLastPage] =>
    [_lastPageNo] => -1
    [_maxRecordCount] => 0
    [datetime] =>
    [adodbFetchMode] => 2
)

I can see:

[Variable_name] => character_set_database
            [Value] => latin1

I suppose that my DB is encoding as latin1, I found more info about the encoding:

character set client utf8
(Valor global) latin1
character set connection utf8
(Valor global) latin1
character set database latin1
character set filesystem binary
character set results utf8
(Valor global) latin1
character set server latin1
character set system utf8
character sets dir /usr/share/mysql/charsets/
collation connection utf8_spanish_ci
(Valor global) latin1_swedish_ci
collation database latin1_swedish_ci
collation server latin1_swedish_ci

 

anonymous profile picture
Account deleted
Posts: 1643

07 September 2009, 7:21

That's kinda interesting. It does say your database is latin1, so you would have to fix that. Why does MySQL allow you to use UTF8 for the connection when the database is latin1 though? I would have thought trying to insert UTF8 data into a latin1 column would cause big problems.

Were you able to fix the encoding of your database? 

anonymous profile picture
Account deleted
Posts: 11

16 September 2009, 11:05

Well, finally I decided to install the 1.1.2 version and upgrade it to the 1.1.6, I try to ask for solutions to the servers administrators but they didn't help me a lot.

Sorry for being so late but I have some problems with the cron task, I will post if I really fix that.

Thanks!

7 results