Reputation: 26
Im quite new with MySQL and SQL in general now im trying to make a table with an approximate length of 31000 which is well in the limit is there something im missing?
CREATE TABLE gdasgds (profileName VARCHAR(255),
profilePic VARCHAR(255),
likes INTEGER,
comments INTEGER,
PostID CHAR(11),
time BIGINT,
type TINYINT,
content VARCHAR(10000),
Options VARCHAR(10000),
Votes VARCHAR(10000));
Upvotes: 1
Views: 294
Reputation: 133360
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.
so check for you real version ..
anyway you can use text for long string (or medium text or long text )
CREATE TABLE gdasgds (
profileName VARCHAR(255),
profilePic VARCHAR(255),
likes INTEGER,
comments INTEGER,
PostID CHAR(11),
time BIGINT,
type TINYINT,
content text,
Options text,
Votes text);
TEXT (and BLOB ) is stored off the table with the table just having a pointer to the location of the actual storage.
VARCHAR is stored inline with the table. VARCHAR is faster when the size is reasonable
for my experience Even with heavy queries (100,0000 lines of text type) no significant differences are noticed.
Upvotes: 1