Coinbase

Author Topic: Database error after upgrading to Mysql 5.7  (Read 1071 times)

0 Members and 1 Guest are viewing this topic.

Offline melktert

  • Newbie
  • *
  • Posts: 3
Database error after upgrading to Mysql 5.7
« on: April 06, 2019, 09:51:18 am »
Hi

I'm getting the following errors in my log since upgrading to Mysql 5.7:

Database Error: Out of range value for column 'HITS' at row 1Apply
Filter: Only show the errors from this file File: /home/brokenwiener/public_html/forums/Sources/LoadAds.php
Line: 298


Forum displays this at the bottom:
Out of range value for column 'HITS' at row 1
File: /home/brokenwiener/public_html/forums/Sources/LoadAds.php
Line: 298

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while your database is at version 2.0.4. The above error might possibly go away if you execute the latest version of upgrade.php.


Error 298 refers to:
Code: [Select]
$smcFunc['db_query']('',"UPDATE {db_prefix}ads SET hits = hits+1 WHERE ADS_ID = $id"); in LoadAds.php

Version Information:
Forum version: SMF 2.0.15 (more detailed)
Current SMF version: SMF 2.0.15
GD version: bundled (2.1.0 compatible)
Database Server: MySQL
MySQL version: 5.7.25-log
PHP: 5.6.40
Server version: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4

Any ideas how to clear this?


« Last Edit: April 06, 2019, 10:11:26 am by melktert »

Offline vbgamer45

  • Owner
  • Full Member
  • *
  • Posts: 156
Re: Database error after upgrading to Mysql 5.7
« Reply #1 on: April 06, 2019, 09:53:05 am »
You have to increase the hits column in the ads table to a larger integer datatype.
Like what I do please support me on https://www.patreon.com/vbgamer45

Offline melktert

  • Newbie
  • *
  • Posts: 3
Re: Database error after upgrading to Mysql 5.7
« Reply #2 on: April 06, 2019, 09:58:53 am »
Thanks

I changed the hits value to 1 and that took the error away.

What datatype do you suggest?

Offline vbgamer45

  • Owner
  • Full Member
  • *
  • Posts: 156
Re: Database error after upgrading to Mysql 5.7
« Reply #3 on: April 06, 2019, 10:00:16 am »
bigint i believe that's what I used in the latest version.
Like what I do please support me on https://www.patreon.com/vbgamer45

Offline melktert

  • Newbie
  • *
  • Posts: 3
Re: Database error after upgrading to Mysql 5.7
« Reply #4 on: April 06, 2019, 10:03:34 am »
Thank you
I've made the change. I did upgrade to latest version but appears it didn't update the database.

Thanks again for your help