A
A
amazinginternetsites2015-11-30 22:32:32
MySQL
amazinginternetsites, 2015-11-30 22:32:32

What to do with MySQL error #1117 (too many columns)?

Good day. The table now has 950 columns.
You need to add 200 more.
But you get MySQL error #1117 (too many columns).
Understand. Maybe the architecture is not optimal, but I'll work on it later.
What can be done so far?
As far as I understand, up to 4000 thousand columns can still be increased somehow.
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
romy4, 2015-11-30
@romy4

And how many lines?

A
Alexander N++, 2015-11-30
@sanchezzzhak

dev.mysql.com/doc/refman/5.1/en/column-count-limit.html
InnoDB has a maximum of 1000 columns and a row size of no more than 64kb of data in total, it says so there (not counting blob fields)
Calculate using the formula

row length = 1
             + (sum of column lengths)
             + (number of NULL columns + delete_flag + 7)/8
             + (number of variable-length columns)

how much do your columns weigh without data.
But, I think it's better to immediately resolve the issue, for example, through a database pattern (I don't know if it can be called that) EAV than endlessly adding columns to failure.
cons er ...
create a bicycle for structure administration and data management.
a large table with values
​​​​or normalize data immediately on the shelves.
UPD There may be more columns, here the limit in the type row may need to be calculated using a formula.

N
nelson, 2015-11-30
@nelson

Split into 2 tables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question