Osclass Support Forums

General osclass questions => Report bug => Topic started by: leraat on November 14, 2021, 12:29:30 PM

Title: create the database structure. Error number: 1214
Post by: leraat on November 14, 2021, 12:29:30 PM
Can't create the database structure. Error number: 1214
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 14, 2021, 02:35:08 PM
@leraat
Make sure to use latest MySQL version, ideally 5.7+ (8.0)
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 23, 2021, 02:58:41 PM
Hi!

First, thanks for a great Classifieds Script! :)

I am also having the same problem as the poster, error code 1214, can't creat database structure when trying to install the CMS.

I have tried with every compatible PHP version from 5.7, 7.1, 7.3, 7.4 and 8.0 etc., it doesn't work. :(

My server is Linux based (hosting) and runs well with all other CMS-systems.

Do you have any suggestions?

Thanks in advance.

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 23, 2021, 03:03:51 PM
@CARS
Make sure your database user has all available privileges.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 23, 2021, 05:53:22 PM
Hi,

Thanks for your reply. :)

Yes, everything is setup correct, all the privileges. :(

I have installed every other CMS with the same database settings. :(

I have no idea why it doesn't work, the exact same database can install for example Wordpress, etc.

Thanks in advance.

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 23, 2021, 07:14:09 PM
https://stackoverflow.com/questions/20964269/1214-the-used-table-type-doesnt-support-fulltext-indexes

It looks you are using old MySQL version.
Try to use 5.7 or 8.0
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 23, 2021, 08:13:50 PM
Hi,

I checked and my hosting company is using the latest version. :(

I have no idea why this is happening, every other CMS works. :(

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 23, 2021, 09:11:47 PM
I guess this problem is because t_item_description table use InnoDB engine and full-text search index.
Previously it was using myisam because innodb did not supported it.
You can update oc-includes/osclass/install/struct.sql and change InnoDB to MyISAM for this one table before installation.

Btw. which one is latest version? Is your database created using latest version as well?
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 23, 2021, 11:02:21 PM
Hi again,

Many thanks for your replies, appreciate it.

I checked again, with phpMyAdmin, and the MySQL has version 5.5.52 mariaDB-cll-lve.

I am running this on a hosting with Linux server php 8.0.

Everything checks "green" if I visit to the install folder URL, but end up with error 1214.

Also, if I go directly to the root folder / URL, where I put OS Classifieds, I get the following error: Fatal error: Uncaught Error: Undefined constant "OC_ADMIN-FOLDER" in...

:(

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 24, 2021, 08:29:08 AM
@CARS
Quote
I checked and my hosting company is using the latest version. :(

Quote
MySQL has version 5.5.52

MySQL      5.5   3 December 2010   Dec 2018

Latest?
... udpate your MySQL and do not try to re-invent wheel ;)
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 24, 2021, 01:42:07 PM
Hi,

They were using it before, but reverted back it seems, and wont update for some while. :(

Is it impossible to run OS Class on the forked version om MySQL = mariaDB, in this case version 5.5.52? :(

Also, do you know why I receive the error message while visiting the root folder URL, before installation?

Thanks again, have a great day.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 24, 2021, 03:06:25 PM
@CARS
Why would you install brand new osclass on MySQL 5.5? Does not make sense at all.
You have to go to file:
oc-includes/osclass/installer/struct.sql

Find this section:
Code: [Select]
CREATE TABLE /*TABLE_PREFIX*/t_item_description (
  fk_i_item_id INT(10) UNSIGNED NOT NULL,
  fk_c_locale_code CHAR(5) NOT NULL,
  s_title VARCHAR(100) NOT NULL,
  s_description MEDIUMTEXT NOT NULL,
  PRIMARY KEY (fk_i_item_id, fk_c_locale_code),
  FULLTEXT s_description (s_description, s_title)
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

And change it to:
Code: [Select]
CREATE TABLE /*TABLE_PREFIX*/t_item_description (
  fk_i_item_id INT(10) UNSIGNED NOT NULL,
  fk_c_locale_code CHAR(5) NOT NULL,
  s_title VARCHAR(100) NOT NULL,
  s_description MEDIUMTEXT NOT NULL,
  PRIMARY KEY (fk_i_item_id, fk_c_locale_code),
  FULLTEXT s_description (s_description, s_title)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

Then you can initiate installation.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 24, 2021, 03:16:08 PM
Hi,

My hosting only has mariaDB 5.5.52 for the moment, I don't know why exactly, they didn't specify.

PHP version is of version 8.0

Will this change in code affect future versions/updates? :(

PS, many thanks for the info. :)

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 24, 2021, 04:02:57 PM
@CARS
If your hosting has only MySQL 5.5, it is not hosting, just some crap... change it, instantly, you are wasting your time.
Database issues are not related to PHP version.

If you install Osclass 8.0.0 with this change, it will not be a problem anymore.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 24, 2021, 04:22:36 PM
Hi,

Believe it or not, but they are actually one of the largest hosting companies here, not some cheap hosting. :O

It is very strange that they only offer mariaDB 5.5.52 (for the moment), I have pointed this out to them. :(

Yes of course, I just wanted to clarify the PHP version. :)

I am receiving the error message I wrote about above, when visiting the root folder / URL, before installing, what could cause that?

Best regards and many thanks for your support.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 24, 2021, 06:57:41 PM
@CARS
Why would you install brand new osclass on MySQL 5.5? Does not make sense at all.
You have to go to file:
oc-includes/osclass/installer/struct.sql

Find this section:
Code: [Select]
CREATE TABLE /*TABLE_PREFIX*/t_item_description (
  fk_i_item_id INT(10) UNSIGNED NOT NULL,
  fk_c_locale_code CHAR(5) NOT NULL,
  s_title VARCHAR(100) NOT NULL,
  s_description MEDIUMTEXT NOT NULL,
  PRIMARY KEY (fk_i_item_id, fk_c_locale_code),
  FULLTEXT s_description (s_description, s_title)
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

And change it to:
Code: [Select]
CREATE TABLE /*TABLE_PREFIX*/t_item_description (
  fk_i_item_id INT(10) UNSIGNED NOT NULL,
  fk_c_locale_code CHAR(5) NOT NULL,
  s_title VARCHAR(100) NOT NULL,
  s_description MEDIUMTEXT NOT NULL,
  PRIMARY KEY (fk_i_item_id, fk_c_locale_code),
  FULLTEXT s_description (s_description, s_title)
) ENGINE=MyISAM DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

Then you can initiate installation.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 24, 2021, 07:07:51 PM
Hi,

Thanks, that works fine. :)

I also receive this before the installation:

Fatal error: Uncaught Error: Undefined constant "OC_ADMIN-FOLDER" in...

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 24, 2021, 07:09:43 PM
Provide full message with file and line reference
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 25, 2021, 02:28:09 AM
Hi,

This is the error message:

Fatal error: Uncaught Error: Undefined constant "OC_ADMIN_FOLDER" in /public_html/oc-includes/osclass/helpers/hErrors.php:108 Stack trace: #0 /public_html/oc-load.php(42): osc_get_absolute_url() #1 /public_html/index.php(25): require_once('/storage/conten...') #2 {main} thrown in /public_html/oc-includes/osclass/helpers/hErrors.php on line 108

Thanks in advance, have a great day.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 25, 2021, 08:10:14 AM
@CARS
Thank you, this notice does not represent issue, but you can fix it in file oc-includes/osclass/install-location.php by adding after this line (line #11):
Code: [Select]
define('LIB_PATH', ABS_PATH . 'oc-includes/');
Following line:
Code: [Select]
define('OC_ADMIN_FOLDER', 'oc-admin');
Will be also fixed in 8.0.1
Thanks ;)
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 25, 2021, 02:27:53 PM
Thanks! =)

One last question, when I change from InnoDB tables to MyISAM, what will happen when my hosting releases MySQL 5.7 and future versions? Can I "upgrade" somehow to InnoDB? Will I also be able to update OS Class just like normal?

Thanks again, have a nice day.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 25, 2021, 02:45:14 PM
@Cars
Nothing will happen and I am not sure if they could upgrade your DB without your knowledge.
You can change engine anytime later on.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on November 25, 2021, 03:41:21 PM
Hi,

Thanks. :)

They will update in about 3 months or so, they told me.

How may I update it afterwards? :) Will everything still work when they update to for example 5.7 and I haven't updated the tables? :)

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on November 25, 2021, 04:26:02 PM
Yes it will work ok after update, currently is osclass tested up to MySQL 8.0
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 07:46:19 AM
Hi,

Many thanks.

I decided to buy another hosting/server, this one installed with php 8.0 and MySQL 5.7/mariaDB 10.2.

To my surprise I still couldn't install OS Class without the error 1214? :O

I don't know why, now I have the latest database etc.?

Also, when uploading all of the files to the root-folder and visit the URL, I receive 500 error with php 8.0, I have to go to the install folder manually. I am redirected though with php 7.4.

But still, the database structure cannot be created even with MySQL 5.7... :( :(

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 01, 2021, 08:57:48 AM
@CARS
You are checking probably weird hosting companies.
If you received error 500, take a look into logs and provide details.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 04:38:13 PM
Hi, thanks, I understand what you mean, but no, this is a premium hosting dedicated server, it is not cheap at all. :(

I have tried with three hosting companies now, the two latest all have MySQL 5.7.

For notice, I haven't tried these just for OS Class, but for other CMS I'm running.

It cannot create the database structure resulting in error 1214.

Anyone else having these problems?

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 01, 2021, 05:30:55 PM
Based on stack overflow, you cannot be using mysql 5.7
https://stackoverflow.com/questions/20964269/1214-the-used-table-type-doesnt-support-fulltext-indexes
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 05:39:45 PM
Hi,

I am checking phpMyAdmin and it says mariaDB 10.2 fully compliant with MySQL 5.7. :(

I don't know what to do now. :(

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 05:46:40 PM
For the 500 error on the server, I only receive it with php version 8.0, not with 7.4.

And it is only if I visit the root folder before installation, it won't redirect me with php 8.0, to the install folder/page.

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 01, 2021, 06:13:12 PM
There is akways somrthing behind error 50p, maybe your hosting disable notifications about errors
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 08:13:21 PM
Thanks for your reply.

Yes, I am trying to check with them about the 500 error.

Regarding 1214 database structure, what do you think about that, since I am running mariaDB 10.2 / MySQL 5.7? :(
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 01, 2021, 08:29:36 PM
Not quite sure what are you running, as you can only run MySQL 5.7 or MariaDB 10.2
Anyway in this case you should use MySQL 5.7 instead of MariaDB. If it will really be 5.7, you should not see 1214 database error.

Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 09:00:13 PM
Hi,

I contacted the hosting now and it is mariaDB 10.2, which they say should be fully compatible with MySQL 5.7.

Any solution how to install OS Class anyway? :(

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 01, 2021, 09:33:55 PM
It was already posted in this thread, so you ask same question.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 01, 2021, 10:41:36 PM
Hi, sorry about that, I formulated me wrong, I meant is it only compatible with the "real" MySQL databases, not mariaDB? Will it support mariaDB in future releases?

Anyone else experience the same issues?

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 02, 2021, 07:49:17 AM
@CARS
Hard to compare if MariaDB 10.2 is older than MySQL 5.7, it will be compatible if you change engine to MyISAM.
Title: Re: create the database structure. Error number: 1214
Post by: mwindey on December 02, 2021, 10:22:52 AM
@Cars

I use 3 different hosting providers (shared hosting)  and with all off them ... cheap to expensive i can install osclass without issues...
My official website uses PHP version: 7.4.22 and 10.3.27-MariaDB-cll-lve
Never have had problems installing databases on them. Even backup and installs on cheap hosting company works fine. Either you are doing something wrong while installing or the expensive hosting company isn't worth the money....Just my thoughts  :-\
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 02, 2021, 10:27:15 AM
I am using cheap hosting company and they provide also mysql 8 for year.php 8 as well. Mariadb 10.5.
If your bosting company does not have it, why eould you pay to such company?
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 02, 2021, 04:44:37 PM
I feel embarrased now, the version is mariaDB 10.2 and the error code isn't 1214 anymore, but 1142, sorry about that.  :-[

I guess it has something to do with the database user not having "SELECT" access?

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 02, 2021, 06:06:48 PM
Error not related to osclass.
This is a mysql command line error message, this Means you are logged into mysql with a default null user with just about zero privileges.

Google before asking, it can save you a lot of time.
How to fix? Contact hosting provider, use mysql user with full privileges.
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 04, 2021, 03:28:54 PM
Hi,

Thanks for your reply.

That's what I thought, I searched for the error code but wasn't sure if there was some specific setting I could change with OS Class for installation. :)

I haven't dealt that much with MySQL before but have looked into it some more these days, so I've set up a server with all the correct privileges now and everything seems to be working OK.

Excited to work with OS Class again, I've had a previous version several years ago.

Many thanks for the great support here.

Have a nice weekend.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 04, 2021, 03:58:15 PM
Cool, glad to hear that  :-*
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 04, 2021, 04:50:32 PM
Hi,

PS, I tried your code change for the following error:

Fatal error: Uncaught Error: Undefined constant "OC_ADMIN_FOLDER" in /public_html/oc-includes/osclass/helpers/hErrors.php:108 Stack trace: #0 /public_html/oc-load.php(42): osc_get_absolute_url() #1 /public_html/index.php(25): require_once('/storage/conten...') #2 {main} thrown in /public_html/oc-includes/osclass/helpers/hErrors.php on line 108

..and unfortunately it doesn't work, I had to use PHP 7.4 in order to install OS Class (to be redirected to the install), with PHP 8 I received the above error 500.

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 04, 2021, 07:44:50 PM
Fatal error: Uncaught Error: Undefined constant "OC_ADMIN_FOLDER" in /public_html/oc-includes/osclass/helpers/hErrors.php:108 Stack trace: #0 /public_html/oc-load.php(42): osc_get_absolute_url() #1 /public_html/index.php(25): require_once('/storage/conten...') #2 {main} thrown in /public_html/oc-includes/osclass/helpers/hErrors.php on line 108

This is fix:
Thank you, this notice does not represent issue, but you can fix it in file oc-includes/osclass/install-location.php by adding after this line (line #11):
Code: [Select]
define('LIB_PATH', ABS_PATH . 'oc-includes/');
Following line:
Code: [Select]
define('OC_ADMIN_FOLDER', 'oc-admin');
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 05, 2021, 01:38:56 AM
Hi,

Thanks, I have added it before.

Unfortunately it doesn't work, I still receive the same error.

Best regards,
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 05, 2021, 09:58:47 AM
Ok will try to reproduce it
Title: Re: create the database structure. Error number: 1214
Post by: CARS on December 06, 2021, 04:36:00 PM
Thanks. :)

Have a good day.
Title: Re: create the database structure. Error number: 1214
Post by: MB Themes on December 06, 2021, 05:28:37 PM
Thank you, I was able to reproduce it.
Backpropagated update to 8.0.0 as well, you can download correct one at:
https://osclass-classifieds.com/download