Bugzilla installation error with MySQL version 8.0 - mysql

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

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.

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.

Try this:
SELECT id FROM database_name.groups where name = ''

Related

Error executing task write() argument must be str, not bytes | MySQL Workbench

After a clean install of Windows 10 when I started to use MySQL workbench I have this error when I try to dump a database.
I could not find anything about it anywhere, the only thing I find are problems with phyton, but nothing related with Workbench.
Output after dumping a database:
08:29:00 Dumping foo(all tables)
Error executing task write() argument must be str, not bytes
08:29:01 Export of b'C:\\Users\\erick\\Documents\\dumps\\Dump20210121 (2).sql' has finished
And the output file is in blank, some ideas?
You can disable (uncheck) the option create schema. It is annoying but it works.
If you have the latest MySQL Workbench (8.0.23), just uninstall and install MySQL Workbench 8.0.20. That worked for me.
Another workaround to this issue is to edit wb_admin_export.py.
In dump_to_folder (line 1679) replace
self.out_pipe = open(path,"w")
with
self.out_pipe = open(path,"wb")
In dump_to_file (line 1957) replace
self.out_pipe = open(self.path,"w")
with
self.out_pipe = open(self.path,"wb")
If you a using version 8.0.23, update to 8.0.25 or above.... it will fix this issue

Did anyone get pgloader to work for migration from Mysql to Postgres

I have installed pgloader using yum install on centos 6.5. I cannot get pgloader to load the following file. My command on the shell is pgloader mysql.load
LOAD DATABASE
from mysql://root:pass123#127.0.0.1:7777/demomysql
into postgresql://postgres:postgres#127.0.0.1:5432/dbname?demopsql
WITH include drop, create tables, no truncate,
create indexes, reset sequences, foreign keys
SET maintenance_work_mem to '128MB', work_mem to '12MB', search_path to 'demopsql'
CAST type datetime to timestamptz
drop default drop not null using zero-dates-to-null,
type date drop not null drop default using zero-dates-to-null
-- MATERIALIZE VIEWS film_list, staff_list
-- INCLUDING ONLY TABLE NAMES MATCHING ~/film/, 'actor'
-- EXCLUDING TABLE NAMES MATCHING ~<ory>
BEFORE LOAD DO
$$ create schema if not exists demopsql; $$;
I get the following log file
pgloader INFO Logger initialized
pgloader WARNING path entry '/usr/share/python-support/pgloader/reformat' does not exists, ignored
pgloader INFO Reformat path is []
pgloader INFO Will consider following sections:
pgloader INFO
pgloader INFO All threads are started, wait for them to terminate
The warning is due to a bug.
Search for he variable DEFAULT_REFORMAT_PATH in /usr/share/pyshared/pgloader/options.py
Replace the path given with
/usr/share/pyshared/reformat.
You also have an error on the the file: dbname?demopsql should be demopsql

Installing Bugzilla 4.2.5 with Mysql 5.6.11

So now I am getting to the final steps of completing the Bugzilla install. I keep getting
'disabledtext' can't have a default value.
This is the complete error.
*Initializing "Dependency Tree Changes" email_setting ...
Updating column disabledtext in table profiles ...
Old: mediumtext DEFAULT '' NOT NULL
New: mediumtext NOT NULL
DBD::mysql::db do failed: BLOB/TEXT column 'disabledtext' can't have a default value [for Statement "ALTER TABLE profiles ALTER COLUMN disabledtext DROP DEFAULT"] at Bugzilla/DB.pm line 729.
Bugzilla::DB::bz_alter_column_raw('Bugzilla::DB::Mysql=HASH(0x6e8f7f0)', 'profiles', 'disabledtext', 'HASH(0xa0a73d0)', 'HASH(0xa0be4a8)', undef) called at Bugzilla/DB.pm line 688
Bugzilla::DB::bz_alter_column('Bugzilla::DB::Mysql=HASH(0x6e8f7f0)', 'profiles', 'disabledtext', 'HASH(0xa0a73d0)') called at Bugzilla/Install/DB.pm line 505
Bugzilla::Install::DB::update_table_definitions('HASH(0x30d53d0)') called at ./checksetup.pl line 199*
Is the actual error in Bugzilla/Install/DB.pm?
Very new at this stuff so any would be great.
Bugzilla = 4.2.5
Mysql = 5.6.11
OS = Suse 12
There was an active bug filed for MySQL 5.6 and Bugzilla 4.2.5 and lower where mySQL 5.6 was not supported and causing a bunch of issues. The bug report is linked the the release notes below.
But to resolve your issue, you can either downgrade MySQL to a 5.5 series or lower, or upgrade BugZilla. BugZilla 4.2.6 was released on May 22nd that provides support for MySQL 5.6, see the release notes linked off of this page.
My advice is to upgrade BugZilla to 4.2.6.

propel could not find postgresql driver - wrong pdo version?

I can't get the propel script running on my system.
My build.properties looks like this:
propel.project = test
# The Propel driver to use for generating SQL, etc.
propel.database = pgsql
# This must be a PDO DSN
propel.database.url = pgsql:host=localhost;port=5432;dbname=test
propel.database.user = user
propel.database.password = password
I get the following error when I run propel-gen . reverse:
[propel-schema-reverse] There was an error building XML from metadata:
/home/user/web/dev/vendor/propel/generator/build-propel.xml:296:1:
could not find driver
pdo_pgsql is enabled (there are several applications running it succesfully); but in my phpinfo there seems to be a wrong version stated:
PostgreSQL(libpq) Version 8.4.13
I'm running PostgreSQL 9.1. I think this causes the error but I have no idea why the versions are different. I have installed first PostGreSQL and then php5-fpm etc. via apt-get.
Using Php 5.3.5 on Ubuntu 11.04. Can somebody help?
Remove all empty spaces and newlines in between the xml tags in the buildtime-conf.xml. That worked for me.
My file looked like this after using the runtime-conf.xml as a template for the buildtime-conf.xml
...
<adapter>
mysql
</adapter>
...
Now it looks like that and it works
...
<adapter>mysql</adapter>
...

Can't create tables in MySQL workbench

I've just installed MySQL workbench on my computer and have importend an old database into the system which seems to be working find. All the data is there and tables. I can do select, insert, updates etc.
However, if I expand a database, I see tables, views, routines. If I then right click on tables, nothing happens if I click create table... However, if I manually type in the create sql command, it creates a table just fine.
The old laptop has:
OS: Ubuntu 10.04.3
MySQL: 5.1.41
MySQL Workbench: 5.2.33
The new laptop has:
OS: Ubuntu 10.04.3
MySQL: 5.1.41
MySQL Workbench: 5.2.37
I have also tried starting mysql workbench using sudo mysql-workbench and I get the same problem.
However, it does give the following output at command line if I start it from the command line on the new laptop:
oshirowanen#laptop:~$ mysql-workbench
Ready.
** Message: query.save_edits built-in command is being overwritten
** Message: query.discard_edits built-in command is being overwritten
** (mysql-workbench-bin:2737): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed
(mysql-workbench-bin:2737): glibmm-CRITICAL **:
unhandled exception (type Glib::Error) in signal handler:
domain: gtk-builder-error-quark
code : 6
what : Unknown internal child: selection
(mysql-workbench-bin:2737): glibmm-CRITICAL **:
unhandled exception (type Glib::Error) in signal handler:
domain: gtk-builder-error-quark
code : 6
what : Unknown internal child: selection
oshirowanen#laptop:~$
On the old laptop I get:
oshirowanen#laptop:~$ mysql-workbench
Log levels '0111000'
disabling log level 0
enabling log level 1
enabling log level 2
enabling log level 3
disabling log level 4
disabling log level 5
disabling log level 6
Ready.
Any idea why I can't create tables using the mouse?
this is a known issue with Ubuntu 10.04:
go to:
/usr/share/mysql-workbench/modules/data/editor_mysql_table_live.glade
and delete all the nodes that look like this:
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection5"/>
</child>