<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Foreign Key issue creating SCM repository in MySQL database in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/3105#M432</link>
    <description>&lt;P&gt;This is a known issue with CM and MySQL 5.6.7 or newer. We're working on it and should have it fixed in an upcoming release.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general, MySQL 5.6 isn't yet supported, so the safest thing you can do is to downgrade to an older version, like 5.5.&amp;nbsp;&lt;SPAN style="line-height: 14px;"&gt;Switching to MyISAM is a really bad idea; a bunch of stuff won't work as expected down the line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2013 22:38:25 GMT</pubDate>
    <dc:creator>adar</dc:creator>
    <dc:date>2013-11-12T22:38:25Z</dc:date>
    <item>
      <title>Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2523#M426</link>
      <description>&lt;P&gt;Installing Cloudera Manager Standard edition and a MySQL database on different (virtual) servers.&lt;/P&gt;&lt;P&gt;When the SCM service is started, several .ddl scripts are executed but it fails with a foreign key constraint error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cloudera Manager server&lt;/P&gt;&lt;PRE&gt;# uname -r
2.6.32-358.23.2.el6.x86_64

# cat /etc/redhat-release
CentOS release 6.4 (Final)

# rpm -aq | grep cloudera
cloudera-manager-server-4.7.2-1.cm472.p0.135.el6.x86_64
cloudera-manager-daemons-4.7.2-1.cm472.p0.135.el6.x86_64

# /usr/share/cmf/schema/scm_prepare_database.sh mysql -h &amp;lt;dbserver&amp;gt; -uadmin -pXXXXXXX --scm-host &amp;lt;clmgr&amp;gt; scm scm scm
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing:  /usr/java/jdk1.7.0_25/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
[2013-10-22 09:50:24,783] INFO     0[main] - com.cloudera.enterprise.dbutil.DbCommandExecutor.testDbConnection(DbCommandExecutor.java:233) - Successfully connected to database.
All done, your SCM database is configured correctly!&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MySQL database server&lt;/P&gt;&lt;PRE&gt;$ mysql -uroot -p
Enter password:
Server version: 5.6.14-log MySQL Community Server (GPL)

mysql&amp;gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| amon               |
| hive               |
| hmon               |
| mysql              |
| nav                |
| performance_schema |
| rman               |
| scm                |
| smon               |
+--------------------+
10 rows in set (0.00 sec)

mysql&amp;gt; use scm;
Database changed
mysql&amp;gt; show tables;
Empty set (0.00 sec)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cloudera Manager server&lt;/P&gt;&lt;PRE&gt;# service cloudera-scm-server start
Starting cloudera-scm-server:                              [  OK  ]

# cat /var/log/cloudera-scm-server/cloudera-scm-server.log
2013-10-22 09:54:26,154  INFO [main:dbutil.DbUtil@203] Schema version table doesn't exist.
2013-10-22 09:54:26,154  INFO [main:dbutil.DbUtil@348] Current database schema version: 0
2013-10-22 09:54:28,731  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: /usr/share/cmf/schema/mysql/00001_cmf_schema.mysql.ddl
2013-10-22 09:54:28,781  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: Updated Schema Version to 1
2013-10-22 09:54:29,226  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: /usr/share/cmf/schema/mysql/00002_cmf_schema.mysql.ddl
...
...
2013-10-22 09:54:36,177  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: Updated Schema Version to 33
2013-10-22 09:54:36,206  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: /usr/share/cmf/schema/mysql/00034_cmf_schema.mysql.ddl
2013-10-22 09:54:36,232  INFO [main:dbutil.SqlScriptRunnerFactory$SqlStringRunner@204] Processed: Updated Schema Version to 34
2013-10-22 09:54:37,074 FATAL [main:cmdline.SqlFile@68] SQL Error at 'UTF-8' line 13:
"alter table CONFIG_REVISIONS
      modify column REVISION_ID bigint not null auto_increment"
Cannot change column 'REVISION_ID': used in a foreign key constraint 'FK_SERVICE_CONFIG_REVISION' of table 'scm.SERVICES'
2013-10-22 09:54:37,074 FATAL [main:cmdline.SqlFile@68] Rolling back SQL transaction.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this error there are&amp;nbsp;Java errors and the SCM services can't be started.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; OLA&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 08:49:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2523#M426</guid>
      <dc:creator>OLA</dc:creator>
      <dc:date>2022-09-16T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2605#M427</link>
      <description>&lt;P&gt;I am having the same issue, any updates on this?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2013 04:10:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2605#M427</guid>
      <dc:creator>Tholinar</dc:creator>
      <dc:date>2013-10-25T04:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2607#M428</link>
      <description>&lt;P&gt;I have a theory. I beleive the script assume you are running myisam which does not enforce Foreign Keys all the well (actualy not at all)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have two choices&lt;/P&gt;&lt;P&gt;1. change your default engine to myisam, not what I would prefer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. alter the ddl scripts in&amp;nbsp;/usr/share/cmf/schema/mysql directory&lt;/P&gt;&lt;P&gt;You will need to add two lines:&lt;/P&gt;&lt;P&gt;After the first update add&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SET FOREIGN_KEY_CHECKS=0;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Then at the bottom of the file add&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SET FOREIGN_KEY_CHECKS=1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;You will need to do that to the following files:&amp;nbsp;&lt;/P&gt;&lt;P&gt;00035_cmf_schema.mysql.ddl&lt;BR /&gt;00043_cmf_schema.mysql.ddl&lt;BR /&gt;04509_cmf_schema.mysql.ddl&lt;BR /&gt;04511_cmf_schema.mysql.ddl&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did this and I got through that part of the install.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2013 04:57:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2607#M428</guid>
      <dc:creator>Tholinar</dc:creator>
      <dc:date>2013-10-25T04:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2609#M429</link>
      <description>&lt;P&gt;Well, never mind, you have to use MyISAM. Lots of stuff breaks if you don't. It would be nice if the table creation scripts set them to MyISAM rather than having to change the default engine to MyISAM&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2013 06:17:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2609#M429</guid>
      <dc:creator>Tholinar</dc:creator>
      <dc:date>2013-10-25T06:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2719#M430</link>
      <description>&lt;P&gt;Thanks for the answer. It's strange that the documentation points to InnoDB but that building the repository fails. I will test it with the ISAM.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 08:38:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/2719#M430</guid>
      <dc:creator>OLA</dc:creator>
      <dc:date>2013-10-29T08:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/3057#M431</link>
      <description>&lt;P&gt;Using MyISAM solved the problem. I've a workaround, thx for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 10:48:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/3057#M431</guid>
      <dc:creator>OLA</dc:creator>
      <dc:date>2013-11-12T10:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Key issue creating SCM repository in MySQL database</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/3105#M432</link>
      <description>&lt;P&gt;This is a known issue with CM and MySQL 5.6.7 or newer. We're working on it and should have it fixed in an upcoming release.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In general, MySQL 5.6 isn't yet supported, so the safest thing you can do is to downgrade to an older version, like 5.5.&amp;nbsp;&lt;SPAN style="line-height: 14px;"&gt;Switching to MyISAM is a really bad idea; a bunch of stuff won't work as expected down the line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:38:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Foreign-Key-issue-creating-SCM-repository-in-MySQL-database/m-p/3105#M432</guid>
      <dc:creator>adar</dc:creator>
      <dc:date>2013-11-12T22:38:25Z</dc:date>
    </item>
  </channel>
</rss>

