Page 1 of 1

Netjukebox 1071 error on startup

Posted: Mon Mar 19, 2018 5:30 pm
by BobRathbone
I am currently installing netjukebox on a Rasberry Pi running Raspbian Stretch with MPD.
Apache2 with PHP7 is installed.

When I start netjukebox the following is displayed:

MySQL create/upgarde error
File:/var/www/html/netjukebox/sql/netjukebox_57.sql
Query: -- -- Indexes for table `server` -- ALTER TABLE `server` ADD PRIMARY KEY (`name`)

MariaDB [netjukebox]> desc server;

Code: Select all

+------------+--------------+------+-----+---------+-------+
| Field      | Type         | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| name       | varchar(255) | NO   |     |         |       |
| value      | varchar(255) | NO   |     |         |       |
| is_integer | tinyint(1)   | NO   |     | 0       |       |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

I tried running the SQL command from netjukebox_57.sql but get a 1071 error:

MariaDB [netjukebox]> ALTER TABLE `server` ADD PRIMARY KEY (`name`);
ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes

My apologies if this is already handled in the forum but I was unable to find a solution.
Any help would be appreciated.

Regards
Bob Rathbone

Re: Netjukebox 1071 error on startup

Posted: Thu Mar 22, 2018 2:30 pm
by wbartels
I found the problem and come back shortly with an update.
https://stackoverflow.com/questions/874 ... 1000-bytes

Re: Netjukebox 1071 error on startup

Posted: Sun Mar 25, 2018 12:12 pm
by wbartels
Hello RobRathbone,

I could reproduce your problem when set the database character set to utf8mb4.
For example the index for `artist` varchar(255) gets to long:
255 characters x 4 bytes > 1000

The problem should be fixed in netjukebox 6.40.
Please let me know if this also worked for you?

Thank,
Willem