Creating tables in MySQL database

29 views
Skip to first unread message

khvalera

unread,
Jun 10, 2021, 5:04:27 AM6/10/21
to bareos-devel
When executing /usr/lib/bareos/scripts/make_bareos_tables --user root --password, I get the following error:


ERROR 1005 (HY000) at line 31: Can't create table `bareos`.`File` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 55: Can't create table `bareos`.`RestoreObject` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 104: Can't create table `bareos`.`Job` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 178: Can't create table `bareos`.`LocationLog` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 199: Can't create table `bareos`.`JobMedia` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 215: Can't create table `bareos`.`Media` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 267: Can't create table `bareos`.`Pool` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 310: Can't create table `bareos`.`Log` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 319: Can't create table `bareos`.`BaseFiles` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1146 (42S02) at line 328: Table 'bareos.BaseFiles' doesn't exist
ERROR 1005 (HY000) at line 378: Can't create table `bareos`.`Quota` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 385: Can't create table `bareos`.`NDMPLevelMap` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 393: Can't create table `bareos`.`NDMPJobEnvironment` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 401: Can't create table `bareos`.`DeviceStats` (errno: 150 "Foreign key constraint is incorrectly formed")
ERROR 1005 (HY000) at line 417: Can't create table `bareos`.`JobStats` (errno: 150 "Foreign key constraint is incorrectly formed")
Creation of Bareos MySQL tables succeeded.

khvalera

unread,
Jun 10, 2021, 5:05:16 AM6/10/21
to bareos-devel
bareos 20.0.1

четверг, 10 июня 2021 г. в 12:04:27 UTC+3, khvalera:

khvalera

unread,
Jun 10, 2021, 7:23:47 AM6/10/21
to bareos-devel
Made a patch for the mysql.sql file:

четверг, 10 июня 2021 г. в 12:05:16 UTC+3, khvalera:
mysql.patch
Message has been deleted

khvalera

unread,
Jun 10, 2021, 9:44:28 AM6/10/21
to bareos-devel
Fix: backup-dir JobId 0: Fatal error: cats/sql_create.cc:96 Create DB Job record INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment) VALUES ( ...
четверг, 10 июня 2021 г. в 14:23:47 UTC+3, khvalera:


четверг, 10 июня 2021 г. в 14:23:47 UTC+3, khvalera:
mysql.patch

Bruno Friedmann

unread,
Jun 12, 2021, 3:23:16 AM6/12/21
to bareos...@googlegroups.com
On jeudi, 10 juin 2021 11.04:27 h CEST khvalera wrote:
> When executing */usr/lib/bareos/scripts/make_bareos_tables --user root
> --password*, I get the following error:
>
>
> ERROR 1005 (HY000) at line 31: Can't create table `bareos`.`File` (errno:
...

Maybe you miss the notice in actual development version

https://docs.bareos.org/bareos-20/Appendix/ReleaseNotes.html


Deprecated

Using MySQL as a catalog backend is now deprecated PR #564
Using Rados as a storage backend is now deprecated PR #672
With full Python 3 support, using Python 2 is now considered deprecated
Plugin bareos-fd-ldap is deprecated, because it requires Python 2

Removed

Remove support for creating MySQL / SQLite catalogs PR #563

I'm guessing there will be more and more kind the same trouble.


--
Bruno Friedmann
Charmoille - Switzerland
GPG-KEY 7DFE46141887FD47

Computing freedom with openSUSE Tumbleweed

Linux 5.12.9-1-default x86_64 GNU/Linux, nvidia: 460.80
Qt: 5.15.2, KDE Frameworks: 5.82.0, Plasma: 5.21.5, kmail2 5.17.1 (21.04.1)



Philipp Storz

unread,
Jun 12, 2021, 7:34:31 AM6/12/21
to bareos...@googlegroups.com
Hello,

thank you very much for your patch.

What mysql version are you using?

Also, I would like to point out that MySQL is deprecated as catalog backend since Bareos 19.

Please do not use mysql in new installations, use postgresql instead.

See

https://docs.bareos.org/IntroductionAndTutorial/InstallingBareos.html?highlight=mysql#decide-about-the-database-backend


Am 10.06.21 um 15:44 schrieb khvalera:
> Fix: backup-dir JobId 0: Fatal error: cats/sql_create.cc:96 Create DB Job record INSERT INTO Job
> (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId,Comment) VALUES ( ...
> четверг, 10 июня 2021 г. в 14:23:47 UTC+3, khvalera:
>
>
> четверг, 10 июня 2021 г. в 14:23:47 UTC+3, khvalera:
>
> Made a patch for the mysql.sql file:
>
> четверг, 10 июня 2021 г. в 12:05:16 UTC+3, khvalera:
>
> bareos 20.0.1
>
> четверг, 10 июня 2021 г. в 12:04:27 UTC+3, khvalera:
>
> When executing */usr/lib/bareos/scripts/make_bareos_tables --user root --password*, I
> --
> You received this message because you are subscribed to the Google Groups "bareos-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> bareos-devel...@googlegroups.com <mailto:bareos-devel...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bareos-devel/63bfae92-60d4-4af1-a52d-c81b3eda9d1fn%40googlegroups.com
> <https://groups.google.com/d/msgid/bareos-devel/63bfae92-60d4-4af1-a52d-c81b3eda9d1fn%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Mit freundlichen Grüßen

Philipp Storz philip...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 63 06 93-92
http://www.bareos.com Fax: +49 221 63 06 93-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Geschäftsführer: Stephan Dühr, M. Außendorf,
J. Steffens, P. Storz

khvalera

unread,
Jun 12, 2021, 8:30:14 AM6/12/21
to bareos-devel
I recently read this news and it's sad, why give up MySQL? On my server, all programs run on MySQL, and now I still have to install postgresql and support it :(

суббота, 12 июня 2021 г. в 10:23:16 UTC+3, friedma...@gmail.com:

khvalera

unread,
Jun 12, 2021, 8:36:10 AM6/12/21
to bareos-devel
To bypass the MySQL installation limitation, you need to add the variable "BAREOS_TEST_RUNNING=1" to the files:
   /usr/lib/bareos/scripts/create_bareos_database
   /usr/lib/bareos/scripts/make_bareos_tables


суббота, 12 июня 2021 г. в 14:34:31 UTC+3, philipp.storz:

Andreas Rogge

unread,
Jul 25, 2021, 2:17:45 PM7/25/21
to bareos...@googlegroups.com
Am 12.06.21 um 14:36 schrieb khvalera:
> on my system uses: mariadb
> <https://archlinux.org/packages/extra/x86_64/mariadb/>10.5.10
> To bypass the MySQL installation limitation, you need to add the
> variable "BAREOS_TEST_RUNNING=1" to the files:
>    /usr/lib/bareos/scripts/create_bareos_database
>    /usr/lib/bareos/scripts/make_bareos_tables
That's the intended effect of that variable, but as the name might give
away this is for (our automated) testing.
You will not be able to upgrade to Bareos 21 with a MySQL or MariaDB
catalog, as support for that is going away.

Best Regards,
Andreas

--
Andreas Rogge andrea...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221-630693-86
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, Philipp Storz
Reply all
Reply to author
Forward
0 new messages