Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi, so I currently have a table with the following datatypes: column1 -> TEXT column2 -> TEXT column3 -> TEXT
This table is huge, with over 500k+ rows. When I initially started using MySQL on DO, I hardly knew what a primary key was, so I never set one up.
However, I’ve encountered a loop of a problem: In order to set a primary key, I must have a column in the database which has a specific amount of characters, e.g. VARCHAR(10). If I don’t have it, I will get something similar to this:
Error: BLOB/TEXT column 'columnName' used in key specification without a key length
However, in order to even set my column to have a specific key length, I have to modify the table.
As a result, I try to modify the table, using something on the lines of MODIFY TABLE tableName ALTER COLUMN columnName VARCHAR(length). Which tells me that:
Error: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.
Which creates an infinite loop of me not even being able to set a primary key in the first place.
Now I’ve took a look about the possibility of perhaps setting the system variable sql_require_primary_key. However after taking a look at stackoverflow I’ve been suggested it’s not possible to do so.
Can someone help me in this? Thank you.
hbarnard
keneucker
keneucker
rich
santoshpatil
Aspiresoftserv
Yakin
Thejaswini-Rao-U
775c69c916d345a7a367d867078ccb
mayricoak
ndam
bc2f52583874402a988f587c00195d