SQL ERROR [ mysql4 ] - Incorrect string value

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
themrb
Registered User
Posts: 1
Joined: Fri Mar 04, 2011 12:37 am

SQL ERROR [ mysql4 ] - Incorrect string value

Post by themrb » Fri Mar 04, 2011 1:14 am

Support Request Template
What version of phpBB are you using? phpBB 3.0.8
What is your board's URL? http://bushido.edgebuilding.com.au
Who do you host your board with? Unsure
How did you install your board? I used the download package from phpBB.com
Is your board a fresh install or a conversion? Fresh Install
Do you have any MODs installed? No
Is registration required to reproduce this issue? No
What styles do you currently have installed? DVGFX
What language(s) is your board currently using? British English
Which database type/version are you using? MySQL 4
What is your level of experience? New to PHP and phpBB
When did your problem begin?

Problem happens when I try to post the character below, which I think is 'Box Light Horizontal', U+2500

"───────​──────────"

(interestingly, the support template didn't like this character either and changed it to a bunch of ?s)

The error is:

SQL ERROR [ mysql4 ]

Incorrect string value: '\xE2\x94\x80\xE2\x94\x80...' for column 'post_text' at row 1 [1366]

SQL

INSERT INTO phpbb_posts (forum_id, poster_id, icon_id, poster_ip, post_time, post_approved, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_locked, topic_id) VALUES (6, 54, 0, '120.151.48.71', 1299200214, 1, 1, 1, 1, 1, '', 'Re: test', '───────​──────────', '1e7a5cce5963f92ff8eda2ca823ce608', 0, '', '2wf0pfvq', 1, 0, 24)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: includes/functions_posting.php
LINE: 1985
CALL: dbal_mysql->sql_query()

FILE: posting.php
LINE: 1137
CALL: submit_post()

Is this an unavoidable problem with the mysql database ... ? Would asking my host to upgrade to mysql 5 solve the problem?

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10344
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Noxwizard » Fri Mar 04, 2011 3:04 am

Follow the instructions in this article: Doesn't have a default value errors
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Sun Sep 18, 2011 10:24 pm

I have the same problem "Incorrect string value..." whenever I cleared the board cache (after pressing F5 in my browser the forum / main page loads normally again). I used the MySQL Upgrader from the Support Tool Kit ("Run"), but after finishing the problem still exists. Are there any other possible solutions to fix this? Thanks!

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Oyabun1 » Sun Sep 18, 2011 10:39 pm

Did you get a message 'The MySQL Upgrader has been run successfully'? If so, it could be the data is cached, so via FTP open the cache folder on the server and delete everything except index.htm and .htaccess (if you can see it).
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Sun Sep 18, 2011 10:47 pm

Oyabun1 wrote:Did you get a message 'The MySQL Upgrader has been run successfully'?
Yes.

I deleted the board cache. The problem always occurs when I do this: I get the error message, but when I (or somebody else) reloads the main page, it goes away.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by D¡cky » Sun Sep 18, 2011 11:55 pm

themrb wrote:Which database type/version are you using? MySQL 4
Is the database version 4.0.x or 4.1.x? The version will be shown in the Administration Control Panel.
Have you hugged someone today?

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Mon Sep 19, 2011 5:54 am

It's 5.1.49
Last edited by Thanks in advance on Tue Sep 20, 2011 10:14 am, edited 1 time in total.

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Mon Sep 19, 2011 2:21 pm

Does the limitation discussed in that thread still exist with phpBB 3.0.8 or 3.0.9 and might be the reason? Does the MySQLUpgrader solve the problem or is the mentioned work-around the "solution"? Shall I use UTF8mb4? uft8_bin? utf8_general_ci? utf8_unicode_ci? *really confused*

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by D¡cky » Tue Sep 20, 2011 3:11 am

Thanks in advance wrote:Does the limitation discussed in that thread still exist with phpBB 3.0.8 or 3.0.9 and might be the reason? Does the MySQLUpgrader solve the problem or is the mentioned work-around the "solution"
The limitation in that thread is not the same as your problem. The mysql_upgrader should have fixed your problem.
Thanks in advance wrote:Shall I use UTF8mb4? uft8_bin? utf8_general_ci? utf8_unicode_ci? *really confused*
What are you using now? The post_text field in the posts table should be utf8_bin. If it is not, set it with this query:

Code: Select all

ALTER TABLE phpbb_posts CHANGE post_text post_text MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
Have you hugged someone today?

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Tue Sep 20, 2011 5:36 am

*deleted*

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Tue Sep 20, 2011 10:13 am

post_text mediumtext utf8_unicode_ci
Last edited by Thanks in advance on Tue Sep 20, 2011 4:33 pm, edited 1 time in total.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by D¡cky » Tue Sep 20, 2011 4:02 pm

Thanks in advance wrote:post_text mediumtext utf8_unicode_ci
post_text should be mediumtext utf8_bin
post_subject should be varchar (255) utf8_unicode_ci

Change post_text to utf8_bin to see if that makes a difference.
Have you hugged someone today?

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Thu Sep 22, 2011 2:46 pm

Is "post_text should be mediumtext utf8_bin" also correct for German boards? Just want to be sure, thanks!

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50805
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by stevemaury » Thu Sep 22, 2011 3:01 pm

Yes.

Ja.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Thanks in advance
Registered User
Posts: 173
Joined: Mon Dec 28, 2009 8:17 am

Re: SQL ERROR [ mysql4 ] - Incorrect string value

Post by Thanks in advance » Thu Sep 22, 2011 3:34 pm

Thanks, Danke! ;)

Locked

Return to “[3.0.x] Support Forum”