[mythtv-users] phpmyadmin no unique on settings table?

Dan Wilga mythtv-users2 at dwilga-linux1.amherst.edu
Thu Jul 2 19:01:37 UTC 2015


On 7/2/15 2:06 PM, Hika van den Hoven wrote:
> Hoi Hika,
>
> Thursday, July 2, 2015, 8:01:48 PM, you wrote:
>
>> Hoi Dan,
>> Thursday, July 2, 2015, 7:19:13 PM, you wrote:
>>> On 7/2/15 11:56 AM, Hika van den Hoven wrote:
>>>> Hoi Dan,
>>>>
>>>> Thursday, July 2, 2015, 2:49:11 PM, you wrote:
>>>>
>>>>> On 7/1/15 10:39 PM, Hika van den Hoven wrote:
>>>>>> Hoi Steven,
>>>>>>
>>>>>> Thursday, July 2, 2015, 4:23:27 AM, you wrote:
>>>>>>
>>>>>>> just got a new system running with an old database and when I go to
>>>>>>> the settings table in phpmyadmin I now get this error,
>>>>>>> "This table does not contain a unique column. Grid edit, checkbox,
>>>>>>> Edit, Copy and Delete features are not available."
>>>>>>> and am unable to edit any of the entries.
>>>>>>> did I do something wrong in my import? or was this table always this
>>>>>>> way, and if so, is there a way to fix this without affecting mythtv?
>>>>>>> can I just add a new column to make it the unique column?
>>>>>> The settings table has no index, so is not easily editable in
>>>>>> phpmyadmin. Probably you got phpmyadmin complaining about a lack of
>>>>>> prime index.
>>>>> Mine has a primary key, and the table should according to
>>>>> libs/libmythtv/dbcheck.cpp:
>>>>> "CREATE TABLE settings ("
>>>>> "  `value` varchar(128) NOT NULL DEFAULT '',"
>>>>> "  `data` varchar(16000) NOT NULL DEFAULT '',"
>>>>> "  hostname varchar(64) DEFAULT NULL,"
>>>>> "  KEY `value` (`value`,hostname)"
>>>>> ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
>>>>> I suggest the OP add it, as operating without one will surely be slower.
>>>>> _______________________________________________
>>>> It's just an Index not a key. A Key does not allow duplicates, so
>>>> unusable
>>> Huh? In SQL the line:
>>>     KEY `value` (`value`,hostname)"
>>> means it's the primary key, not merely an index. An index would use the
>>> keyword INDEX.
>>> _______________________________________________
>> Then you have a problem! It must be an index not a key. If it is a key
>> you kan not have the same value for different hosts!
> I now see you have it on value and hostname. My scheme was
> automatically setup. Originally on 0.26 and then upgraded to 0.27 and
> there only is an Index on value. Maybe you run 0.28?
>
It is most definitely a multi-column key, not an index. What I quoted in 
my original response is taken directly from the 0.27 source code, in 
libs/libmythtv/dbcheck.cpp. So it's your database that is incorrect for 
some reason.


More information about the mythtv-users mailing list