2

Getting an error with creating database with latest MySQL version 8.0 for Bugzilla installation.

I'm setting up a new server for Bugzilla with below configuration.

Bugzilla version : 5.0.6

Strawberry PERL version : 5.28.2.1

MySQL version : 8.0

My current setup is working fine with older version of MySQL 5.7.27. But somehow have to migrate to newer version of MySQL 8.0 and with this I'm getting an error while creating table entry in database.

On google, what I found is that something related to 'GROUPS'. This keyword is reserved in MySQL 8.0 and bugzilla trying to use that keyword. I don't have a knowledge of MySQL so I couldn't figured out this problem.

Below is the output of checksetup.pl

.... ....

Checking for DBD-mysql (v4.001) ok: found v4.050

Checking for MySQL (v5.0.15) ok: found v8.0.17

Adding new table bz_schema...

Initializing bz_schema...

Creating tables...

Converting attach_data maximum size to 100G...

Setting up choices for standard drop-down fields:

priority op_sys resolution bug_status rep_platform bug_severity

Creating ./data directory...

Creating ./data/assets directory...

Creating ./data/attachments directory...

Creating ./data/db directory...

Creating ./data/extensions directory...

Creating ./data/mining directory...

Creating ./data/webdot directory...

Creating ./graphs directory...

Creating ./skins/custom directory...

Creating ./data/extensions/additional...

Creating ./data/mailer.testfile...

Creating ./Bugzilla/.htaccess...

Creating ./data/.htaccess...

Creating ./data/assets/.htaccess...

Creating ./data/attachments/.htaccess...

Creating ./data/webdot/.htaccess...

Creating ./graphs/.htaccess...

Creating ./lib/.htaccess...

Creating ./template/.htaccess...

Creating contrib/.htaccess...

Creating t/.htaccess...

Creating xt/.htaccess...

Precompiling templates...done.

    DBD::mysql::db selectrow_array failed: 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 'groups where name = ''' at line 1 [for Statement "SELECT id FROM groups where name = ''"] at Bugzilla/Install/DB.pm line 2497.

    Bugzilla::Install::DB::_fix_group_with_empty_name() called at Bugzilla/Install/DB.pm line 358

    Bugzilla::Install::DB::update_table_definitions(HASH(0x34e8cb8)) called at checksetup.pl line 175
1

3 Answers 3

5

Starting from Mysql 8.0 groups is reserved word. Conseqently 'groups' cannot be the table name. You can fix it by putting backticks around the table name groups in bugzilla code.

Sign up to request clarification or add additional context in comments.

Comments

2

Groups can still be used, however, you need to add the database name in front of every call to the "GROUPS" table. In the case of Bugzilla standard install, the database name is 'bugs'. Example from line 1643 in DB.pm:

$dbh->do("ALTER TABLE groups DROP PRIMARY KEY");

Changed to:

$dbh->do("ALTER TABLE bugs.groups DROP PRIMARY KEY");

There are about a dozen SQL statements that make a call to that table in DB.pm. You will have to add it to all of them.

1 Comment

I think this will work but not verified at my side as I just sticked to an older version of MySQL 5.27 for a workaround. But surely will use this technique if I want to deploy Bugzilla with MySQL 8.0.
-3

Try this:

SELECT id FROM database_name.groups where name = ''

2 Comments

It would help if you explained how this code solves the problem.
Hi Bruno, I don't know much about MySQL. Can you tell me where I have to check this one? I didn't understand your answer, please explain it briefly it would be great help for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.