Install process fails creating db tables.

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Hamster
Posts: 6
Joined: 01 Jul 2007, 20:58

Install process fails creating db tables.

Post by Hamster »

Hello,

I am trying to install Mantis-1.0.8 on a Linux Ubuntu (7.04 - Feisty Fawn) server.

I have mysql-server version 5.0.38-0ubuntu1 and php 5.2.1-0ubuntu1.2.

I have downloaded the tarball for mantis 1.0.8 and have Apache working to the point where I can successfully load the admin/install.php file.

After filling in the form provided by install.php, I get the following output and error:

Code: Select all

   [ Back to Administration ] Check and Install Database

                         Setting Database Hostname                  GOOD
                         Setting Database Type                      GOOD
                         Checking PHP support for database type     GOOD
                         Setting Database Username                  GOOD
                         Setting Database Password                  GOOD
                         Setting Database Name                      GOOD
                         Setting Admin Username                     GOOD
                         Setting Admin Password                     GOOD
                         Attempting to connect to database as admin GOOD
   Checking Database Server Version
   Running mysql version GOOD
   
   Installing Database
   Create database if it does not exist GOOD
   Attempting to connect to database as user GOOD
   Create Schema ( CreateTableSQL on mantis_config_table ) BAD
   CREATE TABLE mantis_config_table ( config_id VARCHAR(64) NOT NULL, project_id INTEGER NOT NULL DEFAULT 0, user_id INTEGER NOT NULL
   DEFAULT 0, access_reqd INTEGER DEFAULT 0, type INTEGER DEFAULT 90, value XS NOT NULL, PRIMARY KEY (config_id, project_id, user_id)
   )TYPE=MyISAM
   You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
   'XS NOT NULL, PRIMARY KEY (config_id, project_id, user_id) )TYPE' at line 7

   Checks Failed...
   Please correct failed checks
   Retry
Can someone please let me know what I'm doing wrong!

Thanks!

H.
mantis_china
Posts: 13
Joined: 03 Jul 2007, 01:56

Post by mantis_china »

I think, because the file you create dateabase is not Suitable for the mysql version.
Olaf
Posts: 1
Joined: 05 Jul 2007, 14:18

Post by Olaf »

I have the same problem. Both on mySQL 4 and 5
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

You might want to check the patch at:
http://www.mantisbt.org/bugs/view.php?id=8125
http://www.mantisbt.org/bugs/view.php?id=8131

Let me know if it fixes your problem.
Migrate your MantisBT to the MantisHub Cloud
koc
Posts: 1
Joined: 17 Jul 2007, 13:56
Location: Japan
Contact:

Post by koc »

In my case, It went well.

mantis 1.0.8 (WinXP SP2 [XAMPP 1.6.2])
admin/schema.php

line 29
value XS NOTNULL -> value X2 NOTNULL

line 111,112,113
description XS NOTNULL, -> description X2 NOTNULL,
steps_to_reproduce XS NOTNULL, -> steps_to_reproduce X2 NOTNULL,
additional_information XS NOTNULL -> additional_information X2 NOTNULL

line 132
note XS NOTNULL -> note X2 NOTNULL

line 177
filter_string XS NOTNULL -> filter_string X2 NOTNULL

line 189
body XS NOTNULL -> body X2 NOTNULL

line 225
description XS NOTNULL -> description X2 NOTNULL

line 243
description XS NOTNULL, -> description X2 NOTNULL,

line 268
value XS NOTNULL", -> value X2 NOTNULL",

line 316
description XS NOTNULL -> description X2 NOTNULL
pva
Posts: 5
Joined: 13 Jul 2007, 05:25

Help to install mantisbt-1.0.8

Post by pva »

I stumped with the same problem... Could anybody help me to understand installation?

From reading manual seems that installation after step mv <directoryname> mantis should continue in the web interface. And that was my first attempt to install which failed.

:arrow: First attempt. In admin/install.php for I provied Admin Username (to create Database), Admin Password (to create Database) with the root mysql user and password. Result:

Username (for Database) was not created while Database name (for Database) was, with empty tables. All failed and seems that the reason is

Code: Select all

POSSIBLE PROBLEM
Database user doesn't have access to the database ( Access denied for user 'mantis'@'localhost' (using password: YES) )
:arrow: Second attempt. I've created user mantisbt:

Code: Select all

GRANT ALL ON mantisbt.* TO mantisbt@localhost IDENTIFIED BY 'asdfokm';
and entered him in the install form together with valid password. I still provide Admin Username/Password to create tables.

Again database created, but proces fails on:

Code: Select all

Create Schema ( CreateTableSQL on mantis_config_table )

BAD
CREATE TABLE mantis_config_table ( config_id VARCHAR(64) NOT NULL, project_id INTEGER NOT NULL DEFAULT 0, user_id INTEGER NOT NULL DEFAULT 0, access_reqd INTEGER DEFAULT 0, type INTEGER DEFAULT 90, value XS NOT NULL, PRIMARY KEY (config_id, project_id, user_id) )TYPE=MyISAM
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'XS NOT NULL, PRIMARY KEY (config_id, project_id, user_id) )TYPE' at line 7
Yes, although mantisbt could connect to mysql db seems that this query has wrong syntax, as it fails even if I run from mysql client with root user.

BTW. If I press retry, I'll see another warning:

Code: Select all

POSSIBLE PROBLEM
Please ensure that your installation supports the new password scheme used in MySQL 4.1.0 and later. See http://dev.mysql.com/doc/mysql/en/password-hashing.html.
So how should I proceed. I suppose this could be php installation problem, but I do not see any php related errors... Is it possible to enable debugging somehow?

That's amd64 server with dev-db/mysql-5.0.42, dev-lang/php-5.2.2-r1, apache-2, and mantisbt-1.0.8.

vboctor, you mentioned two bugs, and there are some patches there, but could you, please, backport them to 1.0.8? It's hard without digging into code to understand what should I do... Where to apply this:

Code: Select all

537a538,539
> } else {
> $t_result = &$g_db->execute('set schema ' . $f_db_schema);
Should I? How to install mantisbt?
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

pva, the bugs I referred to above were introduced in 1.1.0a3, so they are not applicable to 1.0.8.

koc, why did you need to change XS to X2?
Migrate your MantisBT to the MantisHub Cloud
pva
Posts: 5
Joined: 13 Jul 2007, 05:25

Post by pva »

vboctor, but any hints how to proceed? Could you answer the question: Should I create mysql data base user by myself or manitsbt should do it for me. If yes, why should I provide root database password?

I'd like to note one important thing: I've tried to install mantisbt-1.0.7 and installation passes fine, while I have mentioned above problems with 1.0.8. So seem that there is regression along the way. Thank you for your work in any way.
SeanBDurkin
Posts: 4
Joined: 24 Jul 2007, 07:21

Post by SeanBDurkin »

pva, vboctor,


The schema that 1.0.8 is wrong. The install script uses ...
CREATE TABLE mantis_config_table (
config_id VARCHAR(64) NOT NULL,
project_id INTEGER NOT NULL DEFAULT 0,
user_id INTEGER NOT NULL DEFAULT 0,
access_reqd INTEGER DEFAULT 0,
type INTEGER DEFAULT 90,
value XS NOT NULL,
PRIMARY KEY (config_id, project_id, user_id)
)TYPE=MyISAM;

However this is wrong for MySQL. The problem is that MySQL does not know about the XS data type. The difference between 1.07 (working) and 1.0.8 (not working) is that 1.0.7 correctly uses the data type TEXT instead of XS.

pva, your question "Should I create mysql data base user by myself or manitsbt should do it for me?" is a good one. It high-lights the incompletness of the Mantis installation instructions. My guess is: create it yourself with sql: "CREATE DATABASE `mantis` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;"

Faithfully,
Sean B. Durkin
pva
Posts: 5
Joined: 13 Jul 2007, 05:25

Post by pva »

The following change introduced regression:

Code: Select all

--- /usr/share/webapps/mantisbt/1.0.7/htdocs/core/database_api.php      2007-05-11 15:09:18.000000000 +0400
+++ /usr/share/webapps/mantisbt/1.0.8/htdocs/core/database_api.php      2007-07-23 14:19:22.000000000 +0400
@@ -6,7 +6,7 @@
        # See the README and LICENSE files for details

        # --------------------------------------------------------
-       # $Id: database_api.php,v 1.46.6.1 2006/01/05 03:54:19 thraxisp Exp $
+       # $Id: database_api.php,v 1.46.6.1.4.1 2007/05/26 22:23:50 giallu Exp $
        # --------------------------------------------------------

        ### Database ###
@@ -16,7 +16,7 @@

        $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;

-       require_once( $t_core_dir . 'adodb/adodb.inc.php' );
+       require_once( 'adodb/adodb.inc.php' );

        # An array in which all executed queries are stored.  This is used for profiling
        $g_queries_array = array();
If I revert it back, everything works.

vboctor, could you, please, comment anything here?
pva
Posts: 5
Joined: 13 Jul 2007, 05:25

Post by pva »

*bump*

Any comments here? I can not bump mantisbt in gentoo while this bug (bug?) is in.
pva
Posts: 5
Joined: 13 Jul 2007, 05:25

Post by pva »

lpantos
Posts: 16
Joined: 24 Jan 2007, 16:51

Please explain

Post by lpantos »

I understand that there is a problem and I"m getting the same error as others; I don't understand how to fix it...
can someone please tell me simply how to fix it!
Post Reply