Bacula-users

Re: [Bacula-users] Can't run bacula any more.

2017-03-12 04:21:00
Subject: Re: [Bacula-users] Can't run bacula any more.
From: Kern Sibbald <kern AT sibbald DOT com>
To: "Erik P. Olsen" <epodata AT gmail DOT com>, Bacula <bacula-users AT lists.sourceforge DOT net>
Date: Sun, 12 Mar 2017 09:20:15 +0100
Hello Erik,

Here is a section of the manual regarding getting MySQL running:

============================

Installing and Configuring MySQL - Phase II

At this point, you should have built and installed MySQL, or already have a running MySQL, and you should have configured, built and installed Bacula. If not, please complete these items before proceeding.

Please note that the ./configure used to build Bacula will need to include --with-mysql=mysql-directory, where mysql-directory is the directory name that you specified on the ./configure command for configuring MySQL. This is needed so that Bacula can find the necessary include headers and library files for interfacing to MySQL.

Bacula will install scripts for manipulating the database (create, delete, make tables etc) into the main installation directory. These files will be of the form *_bacula_* (e.g. create_bacula_database). These files are also available in the bacula-src/src/cats directory after running ./configure. If you inspect create_bacula_database, you will see that it calls create_mysql_database. The *_bacula_* files are provided for convenience. It doesn't matter what database you have chosen; create_bacula_database will always create your database.

Now you will create the Bacula MySQL database and the tables that Bacula uses.

  1. Start mysql. You might want to use the startmysql script provided in the Bacula release.

  2. cd install-directory This directory contains the Bacula catalog interface routines.

  3. ./grant_mysql_privileges This script creates unrestricted access rights for the user bacula. You may want to modify it to suit your situation. Please note that none of the userids, including root, are password protected. If you need more security, please assign a password to the root user and to bacula. The program mysqladmin can be used for this.

  4. ./create_mysql_database This script creates the MySQL bacula database. The databases you create as well as the access databases will be located in install-dir/var/ in a subdirectory with the name of the database, where install-dir is the directory name that you specified on the --prefix option. This can be important to know if you want to make a special backup of the Bacula database or to check its size.

  5. ./make_mysql_tables This script creates the MySQL tables used by Bacula.

Each of the three scripts (grant_mysql_privileges, create_mysql_database and make_mysql_tables) allows the addition of a command line argument. This can be useful for specifying the user and or password. For example, you might need to add -u root to the command line to have sufficient privilege to create the Bacula tables.

To take a closer look at the access privileges that you have setup with the above, you can do:

<mysql-directory>/bin/mysql -u root mysql
select * from user;

Newer versions of MySQL (e.g. 5.7) do not automatically create a user when granting permissions with the grant_mysql_privileges, and so the script may fail. In that case, you will want to do something similar to the following:

su
(enter root password)
<mysql-directory>/bin/mysql mysql
create user bacula identified by '<password>';

then re-run the script.
==============================================

If you have installed Bacula, the script is normally in the scripts directory.  Otherwise if you have the source code, it is in <bacula>/src/cats

Best regards,

Kern




On 03/12/2017 09:08 AM, Erik P. Olsen wrote:
Hello Kern,

On 2017-03-12 at 07:05:49 Kern Sibbald wrote:

You probably forgot to run the ./grant_mysql_permissions script.
 
No, I did not forget because I didn't know and this script is not on my
system and further more it is not mentioned in the manual.

--
Regards,
Erik P. Olsen, M.Sc. EE
Solsortvej 30
DK-2000 Frederiksberg
Denmark


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users