Does vanilla MySQL have a table name length limit?
(I've tested to 100 chrs on my modified MySQL - no limit so far.. I don't have vanilla MySQL accessible readily, though, but I wonder if my dynamically-created table schema will run on default MySQL)
Question: What happens if you go over 64 chrs on default MySQL? Can you test this please and paste MySQL error or results if any?
n.b. usage scenario where per user would never select another user's dataset.
18, NDB Cluster imposed a maximum length of 63 characters for names of databases and tables. As of NDB 8.0.
The maximum length of a table name is 64 characters long according to MySQl version 8.0.
This can be accomplished easily with the following query: SELECT TABLE_SCHEMA AS `Database`, TABLE_NAME AS `Table`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)` FROM information_schema.
Table names must follow the rules for SQL Server identifiers, and be less than 128 characters.
Here're the limits
Database: 64
Table: 64
Column: 64
Index: 64
Constraint: 64
Stored Function or Procedure: 64
Trigger: 64
View: 64
Compound Statement Label: 16
http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
The question is based on wrong assumptions.
There shouldn't be a direct answer.
It is duty of every fellow SOer to warn the OP against wrong decision. Instead of helping him wrong way to get your rep points.
Always avoid dynamically-created table schemas. Database schema is not the thing that should be dynamic. The data in the tables - yes. but not tables itself
Note that you are using a relational database. And while it is as simple as an egg to make a relation based on the field value, at the same time it's impossible based on table names.
Therefore, there shouldn't be dynamically created tables and data splitting. Use one table for similar data. That's one of most basic database rules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With