skywalking icon indicating copy to clipboard operation
skywalking copied to clipboard

mysql varchar(300) needed?

Open mbao opened this issue 7 years ago • 5 comments

Question

  • What do you want to know?

I want to use mysql for storage. I see that create table sql use "id VARCHAR(300)", and mysql characterset is utf8mb4, so 300 * 4 > 767 and mysql returns "Index column size too large. The maximum column size is 767 bytes."

I wonder if I can change 300 smaller?

mbao avatar Feb 21 '19 03:02 mbao

If you are using dynamic row size, I think we should be fine varchar(300). Otherwise, may be a problem. The reason we choose 300 is, the endpoint may be long, which should be saved as id in endpoint_inventory table.

wu-sheng avatar Feb 21 '19 03:02 wu-sheng

If you are using dynamic row size, I think we should be fine varchar(300). Otherwise, may be a problem. The reason we choose 300 is, the endpoint may be long, which should be saved as id in endpoint_inventory table.

get it, thanks. "dynamic row size" is set at creating table ,so I have to change the code or create table manually, right?

mbao avatar Feb 21 '19 03:02 mbao

dynamic row size could be set at Database size, or SQL statement, if I remember this right.

wu-sheng avatar Feb 21 '19 05:02 wu-sheng

+1

chpiter avatar Oct 17 '19 14:10 chpiter

mysql 5.6 is not supported!

zxhans avatar Mar 15 '21 03:03 zxhans