Bacula-users

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

2017-03-13 09:07:51
Subject: Re: [Bacula-users] Can't run bacula any more.
From: "Erik P. Olsen" <epodata AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 13 Mar 2017 14:07:04 +0100
On 2017-03-13 at 12:40:52 Richard wrote:

> > Date: Monday, March 13, 2017 12:26:07 +0100
> > From: "Erik P. Olsen" <epodata AT gmail DOT com>
> >
> > On 2017-03-13 at 09:15:17 Richard wrote:
> >   
> >> > Date: Monday, March 13, 2017 07:40:08 +0100
> >> > From: "Erik P. Olsen" <epodata AT gmail DOT com>
> >> > 
> >> > On 2017-03-12 at 18:58:55 Mike Ruskai wrote:
> >> >     
> >> >> On 3/12/2017 10:29, Erik P. Olsen wrote:    
> >> >> > 
> >> >> > [snip]
> >> >> > 
> >> >> > mysql -u bacula
> >> >> > 
> >> >> > was OK.
> >> >> > 
> >> >> > show databases;
> >> >> > 
> >> >> > gave:
> >> >> > 
> >> >> > +--------------------+
> >> >> > | Database           |
> >> >> > +--------------------+
> >> >> > | information_schema |
> >> >> > | test               |
> >> >> > +--------------------+
> >> >> > 
> >> >> > So apparently the scripts did not create the bacula database.
> >> >> > I'll have to see why that happened.
> >> >> >     
> >>   
> >> >> Is your root DB password blank as well?  Were you logged in as
> >> >> root when running the scripts?    
> >> > Root DB password: don't know. I was using su - when running the
> >> > scripts.    
> >> >> 
> >> >> What do you get if you simply type "mysql" on the command line?
> >> >> If you get a prompt, what does "show processlist" report?    
> >> > 
> >> > 
> >> > [root@Erik-PC etc]# exit
> >> > log ud
> >> > [erik@Erik-PC ~]$ mysql
> >> > Welcome to the MariaDB monitor.  Commands end with ; or \g.
> >> > Your MariaDB connection id is 722
> >> > Server version: 10.1.21-MariaDB MariaDB Server
> >> > 
> >> > Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and
> >> > others.
> >> > 
> >> > Type 'help;' or '\h' for help. Type '\c' to clear the current
> >> > input statement.
> >> > 
> >> > MariaDB [(none)]> 
> >> >     
> >> >> 
> >> >> If you weren't logged in as root when running the script, with a
> >> >> blank root DB password, then the DB scripts wouldn't work.
> >> >> 
> >> >> That is, with a secured DB server, this wouldn't work:
> >> >> 
> >> >> /usr/libexec/bacula/create_bacula_database
> >> >> 
> >> >> But this would, provided the password were correct:
> >> >> 
> >> >> /usr/libexec/bacula/create_bacula_database -u root
> >> >> --password=<password>
> >> >> 
> >> >> The scripts don't just fail silently, either.    
> >> 
> >> A slight follow-on. You should invoke mysql as mysql root (mysql -u
> >> root -p [if the password isn't set pressing a CR will get you past
> >> the password prompt]) or after su-ing to system root (and then
> >> don't use the "-u root -p"). Once you have the "mysql>" prompt
> >> issue the "show databases;" command. The output should include the
> >> "mysql" database. If the "bacula" database is also listed that
> >> indicates that it was set up but not permitted to the mysql
> >> "bacula" user. If it's not there (but you see the "mysql"
> >> database) that's an indication that your bacula database creation
> >> effort(s) failed.  
> > 
> > With root I got:
> > 
> > +--------------------+
> >| Database           |
> > +--------------------+
> >| bacula             |
> >| information_schema |
> >| mysql              |
> >| performance_schema |
> >| test               |
> > +--------------------+  
> 
> Now, as system root:
> 
>    mysql bacula
> 
> and once at the "MariaDB [bacula]>" prompt:
>   
>    show tables;
> 
> If it shows a list of the ~25+ tables (likely ending with "Version"),
> then exit mysql/mariadb and (still as system root) run the
> "grant_mysql_privileges" script that's in your /usr/libexec/bacula/
> directory.

Yes, I see 26 rows ending with Version.

> 
> After doing that, then as a normal (non-root) system user, do:
> 
>    mysql -u bacula 
> 
>    [i don't believe that a password is set, but you can look at the   
>     top of the grant script to confirm this.]
> 
>    show databases;

Unfortunately does not show "bacula".

> 
> If it now shows the "bacula" database:
> 
>    use bacula;     
> 
>    show tables;
> 
> Ideally you'll see the same list of ~25 tables.
> 
> If that works, that should indicate that the obvious bacula table
> creation/privileges issue(s) have been resolved, so you should try to
> proceed with bacula (where this all started) and see what you get.
> 
> You may want to double check the "Catalog" section of your
> bacula-dir.conf file (in /etc/bacula) to confirm that the db
> credentials line shows:
> 
>   dbname = "bacula"; dbuser = "bacula"; dbpassword = ""

Yes, this is set in the Catalog section.

I believe I have configured bacula correctly as I have done so many
times without problems and I have not modified the scripts at all. So
to my understanding it should just work first time.

-- 
Erik


 

------------------------------------------------------------------------------
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