<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Common_MySQL_Problems_with_EPrints</id>
	<title>Common MySQL Problems with EPrints - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Common_MySQL_Problems_with_EPrints"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;action=history"/>
	<updated>2026-04-23T08:52:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=16207&amp;oldid=prev</id>
		<title>Th.lauke@arcor.de: link/category added</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=16207&amp;oldid=prev"/>
		<updated>2024-02-19T13:51:51Z</updated>

		<summary type="html">&lt;p&gt;link/category added&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:51, 19 February 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Work_in_Progress]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Documentation Needed‏‎]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Beware | If you plan to follow any of the resolutions described below, make sure you have backed up the database, so you can restore it if things go wrong.}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Beware | If you plan to follow any of the resolutions described below, make sure you have backed up the database, so you can restore it if things go wrong.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l22&quot; &gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above, an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However, (and assuming you are using &amp;lt;code&amp;gt;InnoDB&amp;lt;/code&amp;gt; as the MySQL table engine), to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL 5, so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above, an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However, (and assuming you are using &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Converting_MyISAM_tables_to_InnoDB|&lt;/ins&gt;&amp;lt;code&amp;gt;InnoDB&amp;lt;/code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;as the MySQL table engine), to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL 5, so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Th.lauke@arcor.de</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=14973&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk at 00:36, 6 March 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=14973&amp;oldid=prev"/>
		<updated>2022-03-06T00:36:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 00:36, 6 March 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l54&quot; &gt;Line 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 54:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN volume VARCHAR(9) DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN volume VARCHAR(9) DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ideally running &amp;lt;code&amp;gt;epadmin update &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ARCHIVE_NAME&lt;/del&gt;&amp;lt;/code&amp;gt; would update fields to effect changes to attributes like &amp;lt;code&amp;gt;maxlength&amp;lt;/code&amp;gt;.&amp;#160; Unfortunately, due to the extensive number or scenarios of how fields could be changed, implementing robust ways that will reliably modify MySQL columns, whilst ensuring data is not lost or worse tables becoming corrupted or inconsistent, is a very complex task.&amp;#160; However, writing a script to do a consistency check between the field configuration for EPrints data objects and the structure of these tables in the MySQL database for the archive [https://github.com/eprints/eprints3.4/issues/163 is being investigated].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ideally running &amp;lt;code&amp;gt;epadmin update &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ARCHIVEID&lt;/ins&gt;&amp;lt;/code&amp;gt; would update fields to effect changes to attributes like &amp;lt;code&amp;gt;maxlength&amp;lt;/code&amp;gt;.&amp;#160; Unfortunately, due to the extensive number or scenarios of how fields could be changed, implementing robust ways that will reliably modify MySQL columns, whilst ensuring data is not lost or worse tables becoming corrupted or inconsistent, is a very complex task.&amp;#160; However, writing a script to do a consistency check between the field configuration for EPrints data objects and the structure of these tables in the MySQL database for the archive [https://github.com/eprints/eprints3.4/issues/163 is being investigated].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Too many keys specified ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Too many keys specified ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot; &gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Reason for error ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Reason for error ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above error message will occur when running &amp;lt;code&amp;gt;EPRINTS_PATH/bin/epadmin update &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ARCHIVE_NAME&lt;/del&gt;&amp;lt;/code&amp;gt;.&amp;#160; By default current versions of MySQL installed by Linux package managers (e.g. YUM, APT, etc.) only allow 64 keys per MySQL database table. A key is added when a &amp;lt;code&amp;gt;CREATE INDEX&amp;lt;/code&amp;gt; command is run and EPrints will do this for each new field added to a data object where the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute is set to 1.&amp;#160; However, as the generic default value for this attribute is 1, only if a specific type of field sets this default value to 0, will a field be created without an index.&amp;#160; This is the case for &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;keywords&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;secret&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;storable&amp;lt;/code&amp;gt; type fields and their sub-types.&amp;#160; However, this is not the case for other types, which is in most cases appropriate, as it cannot take into account in what way and how frequently the field will be used and therefore if the MySQL column would really benefit from an index.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above error message will occur when running &amp;lt;code&amp;gt;EPRINTS_PATH/bin/epadmin update &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ARCHIVEID&lt;/ins&gt;&amp;lt;/code&amp;gt;.&amp;#160; By default current versions of MySQL installed by Linux package managers (e.g. YUM, APT, etc.) only allow 64 keys per MySQL database table. A key is added when a &amp;lt;code&amp;gt;CREATE INDEX&amp;lt;/code&amp;gt; command is run and EPrints will do this for each new field added to a data object where the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute is set to 1.&amp;#160; However, as the generic default value for this attribute is 1, only if a specific type of field sets this default value to 0, will a field be created without an index.&amp;#160; This is the case for &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;keywords&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;secret&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;storable&amp;lt;/code&amp;gt; type fields and their sub-types.&amp;#160; However, this is not the case for other types, which is in most cases appropriate, as it cannot take into account in what way and how frequently the field will be used and therefore if the MySQL column would really benefit from an index.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The reason &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; has the generic default value of 1 is that having a field indexed should speed up database queries, particularly when results need to be ordered.&amp;#160; It was felt it was unlikely that repository system administrators would explicitly set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; to 1 for new fields they would be creating, as they may not appreciate the reasons for doing so.&amp;#160; Therefore, a lot of fields that would benefit from an index could have ended up not getting one.&amp;#160; However, particularly with highly bespoke EPrints archives, the number of columns that require indexes in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; MySQL table has grown close if not beyond the limit of 64 keys, prompting the error message shown above.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The reason &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; has the generic default value of 1 is that having a field indexed should speed up database queries, particularly when results need to be ordered.&amp;#160; It was felt it was unlikely that repository system administrators would explicitly set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; to 1 for new fields they would be creating, as they may not appreciate the reasons for doing so.&amp;#160; Therefore, a lot of fields that would benefit from an index could have ended up not getting one.&amp;#160; However, particularly with highly bespoke EPrints archives, the number of columns that require indexes in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; MySQL table has grown close if not beyond the limit of 64 keys, prompting the error message shown above.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13860&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: /* Resolution */</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13860&amp;oldid=prev"/>
		<updated>2021-09-11T09:55:02Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Resolution&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:55, 11 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot; &gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to remove a multiple (non-compound) field the MySQL commands are more like:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you want to remove a multiple (non-compound) field the MySQL commands are more like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; DROP TABLE &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;eprints_unused&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; DROP TABLE &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;eprint_unused&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If it is a multiple and compound field the MySQL commmands will probably be something like:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If it is a multiple and compound field the MySQL commmands will probably be something like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; DROP TABLE &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;eprints_unused&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; DROP TABLE &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;eprint_unused&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield1;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield1;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield2;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield2;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13859&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Added extra advice with dealing with too many longtext fields.</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13859&amp;oldid=prev"/>
		<updated>2021-09-11T09:54:23Z</updated>

		<summary type="html">&lt;p&gt;Added extra advice with dealing with too many longtext fields.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:54, 11 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l29&quot; &gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint ROW_FORMAT=DYNAMIC;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint ROW_FORMAT=DYNAMIC;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; maybe useful for particularly large (multi-gigabyte) tables but there may be a performance trade-off to doing so. Therefore, if there is not a disk space constraint, &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; is probably the better choice.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; maybe useful for particularly large (multi-gigabyte) tables but there may be a performance trade-off to doing so. Therefore, if there is not a disk space constraint, &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; is probably the better choice.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you use &amp;lt;code&amp;gt;ROW_FORMAT=DYNAMIC&amp;lt;/code&amp;gt; you may still get the original &amp;quot;Row size too large&amp;quot; error message if you have more than 196 &amp;lt;code&amp;gt;LONGTEXT&amp;lt;/code&amp;gt; columns whilst using certain versions of MySQL (e.g. 5.7).&amp;#160; If your repository has added a lot of bespoke fields for the eprint data object, there is a fair chance your &amp;lt;code&amp;gt;eprint__ordervalues_en&amp;lt;/code&amp;gt; will be close to this 196 limit on &amp;lt;code&amp;gt;LONGTEXT&amp;lt;/code&amp;gt; columns.&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;It is likely that the eprint database tables will still include a number of fields that were created, never used and their definitions removed from the repository's configuration.&amp;#160; If this is the case, this may help alleviate the problem of hitting this 196 &amp;lt;code&amp;gt;LONGTEXT&amp;lt;/code&amp;gt; columns limit, as these fields can be manually removed from the eprint database tables.&amp;#160; It is probably best to focus on removing single and non-compound rather than multiple compound fields, as the process to remove these is more straightforward.&amp;#160; In the examples below the field to remove (or column to drop) is called '''unused''':&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint DROP COLUMN unused;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you want to remove a multiple (non-compound) field the MySQL commands are more like:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; DROP TABLE eprints_unused;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If it is a multiple and compound field the MySQL commmands will probably be something like:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; DROP TABLE eprints_unused;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield1;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint__ordervalues_en DROP COLUMN unused_subfield2;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data length too long for column ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data length too long for column ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13848&amp;oldid=prev</id>
		<title>Th.lauke@arcor.de: formatting/spelling corrected</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13848&amp;oldid=prev"/>
		<updated>2021-08-16T18:20:43Z</updated>

		<summary type="html">&lt;p&gt;formatting/spelling corrected&lt;/p&gt;
&lt;a href=&quot;https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;amp;diff=13848&amp;amp;oldid=13847&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Th.lauke@arcor.de</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13847&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Updated reason for error to explain about different fields types and whether sql_index is set to 0 or 1 by default.</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13847&amp;oldid=prev"/>
		<updated>2021-08-12T09:28:26Z</updated>

		<summary type="html">&lt;p&gt;Updated reason for error to explain about different fields types and whether sql_index is set to 0 or 1 by default.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:28, 12 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot; &gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Reason for error ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Reason for error ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above error message will occur when running &amp;lt;code&amp;gt;EPRINTS_PATH/bin/epadmin update ARCHIVE_NAME&amp;lt;/code&amp;gt;.&amp;#160; By default current versions of MySQL installed by Linux package &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;manager &lt;/del&gt;(e.g. YUM, APT, etc.) only allow 64 keys per MySQL database table. A key is added when a &amp;lt;code&amp;gt;CREATE INDEX&amp;lt;/code&amp;gt; command is run and EPrints will do this for each new field added to a data object where the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute is set to 1.&amp;#160; However, as for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;most types &lt;/del&gt;of field this is the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;default value &lt;/del&gt;for &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sql_index&lt;/del&gt;&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a lot of keys can be used&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;particularly by the &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;eprint&lt;/del&gt;&amp;lt;/code&amp;gt; MySQL &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;table&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The above error message will occur when running &amp;lt;code&amp;gt;EPRINTS_PATH/bin/epadmin update ARCHIVE_NAME&amp;lt;/code&amp;gt;.&amp;#160; By default current versions of MySQL installed by Linux package &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;managers &lt;/ins&gt;(e.g. YUM, APT, etc.) only allow 64 keys per MySQL database table. A key is added when a &amp;lt;code&amp;gt;CREATE INDEX&amp;lt;/code&amp;gt; command is run and EPrints will do this for each new field added to a data object where the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute is set to 1.&amp;#160; However, as &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the generic default value &lt;/ins&gt;for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;this attribute is 1, only if a specific type &lt;/ins&gt;of field &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sets &lt;/ins&gt;this &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;default value to 0, will a field be created without an index.&amp;#160; This &lt;/ins&gt;is the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;case &lt;/ins&gt;for &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;text&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;keywords&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;secret&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;storable&lt;/ins&gt;&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;type fields and their sub-types.&amp;#160; However, this is not the case for other types, which is most cases is appropriate, as it it cannot take into account in what way and how frequently the field will be used and therefore if the &lt;/ins&gt;MySQL &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;column would really benefit from an index&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The reason &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;typically &lt;/del&gt;has &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/del&gt;default value of 1 is that having a field indexed should speed up database queries, particularly when results need to be ordered.&amp;#160; It was felt it was unlikely that repository system administrators would explicitly set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; to 1, as they may not appreciate the reasons for doing so &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and therefore &lt;/del&gt;a lot of fields that would benefit from an index &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;would &lt;/del&gt;not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;get &lt;/del&gt;one.&amp;#160; However, particularly with highly bespoke EPrints archives, the number of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fields &lt;/del&gt;that require indexes in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; MySQL &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;tabel &lt;/del&gt;has grown close if not beyond the limit of 64 keys, prompting the error message shown above.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The reason &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; has &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the generic &lt;/ins&gt;default value of 1 is that having a field indexed should speed up database queries, particularly when results need to be ordered.&amp;#160; It was felt it was unlikely that repository system administrators would explicitly set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; to 1 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;for new fields they would be creating&lt;/ins&gt;, as they may not appreciate the reasons for doing so&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;#160; Therefore, &lt;/ins&gt;a lot of fields that would benefit from an index &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;could have ended up &lt;/ins&gt;not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;getting &lt;/ins&gt;one.&amp;#160; However, particularly with highly bespoke EPrints archives, the number of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;columns &lt;/ins&gt;that require indexes in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; MySQL &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;table &lt;/ins&gt;has grown close if not beyond the limit of 64 keys, prompting the error message shown above.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Resolution ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Resolution ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is a two-fold approach to this.&amp;#160; One part if to change the EPrints field configuration and set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute to 0 for types of field that have this set to 1 by default.&amp;#160; However, this will only be useful on the fields that are complained about when running &amp;lt;code&amp;gt;epadmin update&amp;lt;/code&amp;gt;, as there indexes will not have been created due to the limit being reached and therefore you would just be removing the need for them being created.&amp;#160; However, some of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/del&gt;new fields may benefit from having indexes but some existing fields may not or at least benefit significantly less.&amp;#160; The best way to determine this is to look at the existing indexes for the MySQL table for the particular data object, typically &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;.&amp;#160; The following MySQL command can retrieve &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/del&gt;information:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is a two-fold approach to this.&amp;#160; One part if to change the EPrints field configuration and set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute to 0 for types of field that have this set to 1 by default.&amp;#160; However, this will only be useful on the fields that are complained about when running &amp;lt;code&amp;gt;epadmin update&amp;lt;/code&amp;gt;, as there indexes will not have been created due to the limit being reached and therefore you would just be removing the need for them being created.&amp;#160; However, some of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;these &lt;/ins&gt;new fields may benefit from having indexes but some existing fields may not or at least benefit significantly less.&amp;#160; The best way to determine this is to look at the existing indexes for the MySQL table for the particular data object, typically &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;.&amp;#160; The following MySQL command can retrieve &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;this &lt;/ins&gt;information:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; SHOW INDEX FROM eprint;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; SHOW INDEX FROM eprint;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then there are a number of considerations about which fields could do &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;with out &lt;/del&gt;an index.&amp;#160; Generally, those that store numerical values where comparison are required greatly benefit from an index, so date/time fields like &amp;lt;code&amp;gt;datestamp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lastmod&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; greatly benefit from an index, especially it combines the six separate MySQL columns that make up these EPrint fields (i.e. year, month, day, hour minute and second).&amp;#160; The fields that are less important to have index are the ones that are sparsely used, so fields specific to a particular type of eprint that is not commonly used.&amp;#160; A rough guide is that if the field is used in your archive's advanced search or staff search for eprints, then you would not want to remove its index.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then there are a number of considerations about which fields could do &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;without &lt;/ins&gt;an index.&amp;#160; Generally, those that store numerical values where comparison are required greatly benefit from an index, so date/time fields like &amp;lt;code&amp;gt;datestamp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lastmod&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; greatly benefit from an index, especially &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as &lt;/ins&gt;it combines the six separate MySQL columns that make up these EPrint fields (i.e. year, month, day, hour minute and second).&amp;#160; The fields that are less important to have index are the ones that are sparsely used, so fields specific to a particular type of eprint that is not commonly used.&amp;#160; A rough guide is that if the field is used in your archive's advanced search or staff search for eprints, then you would not want to remove its index.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following standard &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;fields fit into the category of non-numeric and sparsely used, roughly in ascending order or use: &amp;lt;code&amp;gt;gscholar_cluster&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gscholar_impact&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pedagogic_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;num_pieces&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;succeeds&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;importid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;monograph_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sword_depositor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;event_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pres_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;contact_email&amp;lt;/code&amp;gt;.&amp;#160; However, the reason you will have hit your limit of keys is due to non-standard fields that will have been added to the archive so it is worth reviewing which of these are used sparsely and do not contain numeric values that are likely to have comparators or other mathematical operations applied to them.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following standard &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; fields fit into the category of non-numeric and&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/or &lt;/ins&gt;sparsely used, roughly in ascending order or use: &amp;lt;code&amp;gt;gscholar_cluster&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gscholar_impact&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pedagogic_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;num_pieces&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;succeeds&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;importid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;monograph_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sword_depositor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;event_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pres_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;contact_email&amp;lt;/code&amp;gt;.&amp;#160; However, the reason you will have hit your limit of keys is due to non-standard fields that will have been added to the archive so it is worth reviewing which of these are used sparsely and do not contain numeric values that are likely to have comparators or other mathematical operations applied to them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Once you have identified the fields that least need indexes as well as setting the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute for the field to 0 (and reloading the webserver and EPrints indexer), you will need to make sure the index has been dropped from MySQL itself. Using a MySQL command like the following:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Once you have identified the fields that least need indexes as well as setting the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute for the field to 0 (and reloading the webserver and EPrints indexer), you will need to make sure the index has been dropped from MySQL itself. Using a MySQL command like the following:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13846&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Finished resolution for Too many keys.</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13846&amp;oldid=prev"/>
		<updated>2021-08-12T09:00:08Z</updated>

		<summary type="html">&lt;p&gt;Finished resolution for Too many keys.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:00, 12 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l53&quot; &gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Resolution ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Resolution ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is a two-fold approach to this.&amp;#160; One part if to change the EPrints field configuration and set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute to 0.&amp;#160; However, this will only be useful on the fields that are complained about when running &amp;lt;code&amp;gt;epadmin update&amp;lt;/code&amp;gt;, as there indexes will not have been created due to the limit being reached and therefore you would just be removing the need for them being created.&amp;#160; However, some of the new fields may benefit from having indexes but some existing fields may not or at least benefit significantly less.&amp;#160; The best way to determine this is to look at the existing indexes for the MySQL table for the particular data object, typically &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;.&amp;#160; The following MySQL command can retrieve that information:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There is a two-fold approach to this.&amp;#160; One part if to change the EPrints field configuration and set the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute to 0 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;for types of field that have this set to 1 by default&lt;/ins&gt;.&amp;#160; However, this will only be useful on the fields that are complained about when running &amp;lt;code&amp;gt;epadmin update&amp;lt;/code&amp;gt;, as there indexes will not have been created due to the limit being reached and therefore you would just be removing the need for them being created.&amp;#160; However, some of the new fields may benefit from having indexes but some existing fields may not or at least benefit significantly less.&amp;#160; The best way to determine this is to look at the existing indexes for the MySQL table for the particular data object, typically &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;.&amp;#160; The following MySQL command can retrieve that information:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; SHOW INDEX FROM eprint;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; SHOW INDEX FROM eprint;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then there are a number of considerations about which fields could do with out an index.&amp;#160; Generally, those that store numerical values where comparison are required greatly benefit from an index, so date/time fields like &amp;lt;code&amp;gt;datestamp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lastmod&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; greatly benefit from an index, especially it combines the six separate MySQL columns that make up these EPrint fields (i.e. year, month, day, hour minute and second).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Then there are a number of considerations about which fields could do with out an index.&amp;#160; Generally, those that store numerical values where comparison are required greatly benefit from an index, so date/time fields like &amp;lt;code&amp;gt;datestamp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lastmod&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; greatly benefit from an index, especially it combines the six separate MySQL columns that make up these EPrint fields (i.e. year, month, day, hour minute and second). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; The fields that are less important to have index are the ones that are sparsely used, so fields specific to a particular type of eprint that is not commonly used.&amp;#160; A rough guide is that if the field is used in your archive's advanced search or staff search for eprints, then you would not want to remove its index.&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''To &lt;/del&gt;be &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;completed'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The following standard &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt;fields fit into the category of non-numeric and sparsely used, roughly in ascending order or use: &amp;lt;code&amp;gt;gscholar_cluster&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gscholar_impact&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;template&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pedagogic_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;num_pieces&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;succeeds&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;importid&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;monograph_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sword_depositor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;thesis_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;event_type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pres_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;contact_email&amp;lt;/code&amp;gt;.&amp;#160; However, the reason you will have hit your limit of keys is due to non-standard fields that will have been added to the archive so it is worth reviewing which of these are used sparsely and do not contain numeric values that are likely to have comparators or other mathematical operations applied to them.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Once you have identified the fields that least need indexes as well as setting the &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; attribute for the field to 0 (and reloading the webserver and EPrints indexer), you will need to make sure the index has been dropped from MySQL itself. Using a MySQL command like the following:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; DROP INDEX gscholar_cluster_0 ON eprint;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;You will note that the index will have a slightly different name to the field.&amp;#160; You should the &amp;lt;code&amp;gt;SHOW INDEX&amp;lt;/code&amp;gt; MySQL command above to determine the correct name for the index.&amp;#160; After doing this you should &lt;/ins&gt;be &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;able to add new fields without seeing the &amp;quot;Too many keys&amp;quot; error message.&amp;#160; However, be sure to set &amp;lt;code&amp;gt;sql_index&amp;lt;/code&amp;gt; to 0 on new fields you add if they are of a type that creates and index but you expect them to be sparsely used.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Duplicate entry for key ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Duplicate entry for key ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13845&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Added advice about altering ordervalues_en tables as well as the data object (e.g. eprint) table</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13845&amp;oldid=prev"/>
		<updated>2021-08-12T07:46:17Z</updated>

		<summary type="html">&lt;p&gt;Added advice about altering ordervalues_en tables as well as the data object (e.g. eprint) table&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 07:46, 12 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot; &gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One potential issue with doing this is that if you were to recreate the database (say on a test instance of your repository), these fields would be recreated as &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt;.&amp;#160; Currently, there is no way to define a field in EPrints that will that will create a MySQL &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; column.&amp;#160; Therefore, for simplicity it may be easier to change the attribute type of these field to &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt; (e.g. &amp;lt;code&amp;gt;type =&amp;gt; 'longtext'&amp;lt;/code&amp;gt;) in the EPrints configuration for this field, even though this allow text strings over 4 million characters long (although UTF-8 encoding would only allow strings up to a third of this length).&amp;#160; To complete this change you would also need to manually run the following MySQL command to update the MySQL table column, e.g.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One potential issue with doing this is that if you were to recreate the database (say on a test instance of your repository), these fields would be recreated as &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt;.&amp;#160; Currently, there is no way to define a field in EPrints that will that will create a MySQL &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; column.&amp;#160; Therefore, for simplicity it may be easier to change the attribute type of these field to &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt; (e.g. &amp;lt;code&amp;gt;type =&amp;gt; 'longtext'&amp;lt;/code&amp;gt;) in the EPrints configuration for this field, even though this allow text strings over 4 million characters long (although UTF-8 encoding would only allow strings up to a third of this length).&amp;#160; To complete this change you would also need to manually run the following MySQL command to update the MySQL table column, e.g.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you modify the type of MySQL column in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; table it would also be sensible to make sure that the equivalent column in the &amp;lt;code&amp;gt;eprint__ordervalues_en&amp;lt;/code&amp;gt; (and other &amp;lt;code&amp;gt;eprint__ordervalues&amp;lt;/code&amp;gt; tables if your archive supports multiple languages) is also updated to use &amp;lt;code&amp;gt;LONGTEXT&amp;lt;/code&amp;gt;. (Although this is likely to be the case, unless the particular field was added to the archive some time ago).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ALTER TABLE eprint__ordervalues_en MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However, (and assuming you are using &amp;lt;code&amp;gt;InnoDB&amp;lt;/code&amp;gt; as the MySQL table engine), to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL 5, so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, &lt;/ins&gt;an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However, (and assuming you are using &amp;lt;code&amp;gt;InnoDB&amp;lt;/code&amp;gt; as the MySQL table engine), to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL 5, so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13844&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: /* Resolution */</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13844&amp;oldid=prev"/>
		<updated>2021-08-12T07:29:24Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Resolution&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 07:29, 12 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However, to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As the example error messages says above an alternative resolution to this problem could be to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt;.&amp;#160; However&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, (and assuming you are using &amp;lt;code&amp;gt;InnoDB&amp;lt;/code&amp;gt; as the MySQL table engine)&lt;/ins&gt;, to do this you need to have the MySQL configuration parameters &amp;lt;code&amp;gt;innodb_file_format&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;innodb_file_format_max&amp;lt;/code&amp;gt; needs to be set to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;Antelope&amp;lt;/code&amp;gt;.&amp;#160; &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; does not become the default until MySQL 5.7 but earlier versions of MySQL should still support MySQL &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;5, &lt;/ins&gt;so you can change to &amp;lt;code&amp;gt;Barracuda&amp;lt;/code&amp;gt; by setting the following configuration settings under the &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; section of &amp;lt;code&amp;gt;/etc/my.cnf&amp;lt;/code&amp;gt; and restart MySQL:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; innodb_file_format_max=Barracuda&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot; &gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can then alter the table to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; as follows:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can then alter the table to change the &amp;lt;code&amp;gt;ROW_FORMAT&amp;lt;/code&amp;gt; as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint ROW_FORMAT=DYNAMIC;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint ROW_FORMAT=DYNAMIC;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; maybe useful for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;particular &lt;/del&gt;large (multi-gigabyte) tables but there may be a performance trade off to doing so. Therefore, if there is not disk space &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;constraints &lt;/del&gt;&amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; is probably the better choice.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using &amp;lt;code&amp;gt;COMPRESSED&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; maybe useful for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;particularly &lt;/ins&gt;large (multi-gigabyte) tables but there may be a performance trade&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-&lt;/ins&gt;off to doing so. Therefore, if there is not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a &lt;/ins&gt;disk space &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;constraint, &lt;/ins&gt;&amp;lt;code&amp;gt;DYNAMIC&amp;lt;/code&amp;gt; is probably the better choice.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data length too long for column ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Data length too long for column ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13843&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: /* Resolution */</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Common_MySQL_Problems_with_EPrints&amp;diff=13843&amp;oldid=prev"/>
		<updated>2021-08-12T01:00:05Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Resolution&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 01:00, 12 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot; &gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Currently the only way to fix this problem is to manually modify various &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; columns in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; and make them &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; or possibly &amp;lt;code&amp;gt;TINYTEXT&amp;lt;/code&amp;gt; that would make them the same length as the original &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; column.&amp;#160; The columns you should choose are those most likely to use a large number of characters.&amp;#160; This may include fields like &amp;lt;code&amp;gt;publication&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;book_title&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;id_number&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;event_title&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;publisher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;contact_email&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;series&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;department&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;institution&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;place_of_pub&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;event_dates&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Currently the only way to fix this problem is to manually modify various &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; columns in the &amp;lt;code&amp;gt;eprint&amp;lt;/code&amp;gt; and make them &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; or possibly &amp;lt;code&amp;gt;TINYTEXT&amp;lt;/code&amp;gt; that would make them the same length as the original &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; column.&amp;#160; The columns you should choose are those most likely to use a large number of characters.&amp;#160; This may include fields like &amp;lt;code&amp;gt;publication&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;book_title&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;id_number&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;event_title&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;publisher&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;contact_email&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;series&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;department&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;institution&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;place_of_pub&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;event_dates&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One potential issue with doing this is that if you were to recreate the database (say on a test instance of your repository), these fields would be recreated as &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt;.&amp;#160; Currently, there is no way to define a field in EPrints that will that will create a MySQL &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; column.&amp;#160; Therefore, for simplicity it may be easier to change the attribute type of these field to &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt; (e.g. &amp;lt;code&amp;gt;type =&amp;gt; 'longtext'&amp;lt;/code&amp;gt; in the EPrints configuration for this field, even though this allow text strings over 4 million characters long (although UTF-8 encoding would only allow strings up to a third of this length).&amp;#160; To complete this change you would also need to manually run the following MySQL command to update the MySQL table column, e.g.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One potential issue with doing this is that if you were to recreate the database (say on a test instance of your repository), these fields would be recreated as &amp;lt;code&amp;gt;VARCHAR(255)&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt;.&amp;#160; Currently, there is no way to define a field in EPrints that will that will create a MySQL &amp;lt;code&amp;gt;TEXT&amp;lt;/code&amp;gt; column.&amp;#160; Therefore, for simplicity it may be easier to change the attribute type of these field to &amp;lt;code&amp;gt;longtext&amp;lt;/code&amp;gt; (e.g. &amp;lt;code&amp;gt;type =&amp;gt; 'longtext'&amp;lt;/code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;) &lt;/ins&gt;in the EPrints configuration for this field, even though this allow text strings over 4 million characters long (although UTF-8 encoding would only allow strings up to a third of this length).&amp;#160; To complete this change you would also need to manually run the following MySQL command to update the MySQL table column, e.g.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; ALTER TABLE eprint MODIFY COLUMN publication LONGTEXT DEFAULT NULL;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
</feed>