Quantcast

Can't run bacula any more.

classic Classic list List threaded Threaded
79 messages Options
1234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Gary R. Schmidt-3
On 16/03/2017 18:00, Erik P. Olsen wrote:

> On 2017-03-15 at 21:17:07 Dan Langille wrote:
>
>>> On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]> wrote:
>>>
>>> On 2017-03-13 at 22:52:04 Richard wrote:
>>>
>>>> What you have for privileges is what I would expect. My
>>>> "grant_mysql_privileges" script has two lines - the first will do the
>>>> "localhost" setup for the bacula user. Assuming that your script is
>>>> lacking that, you might want to add it and try rerunning the script.
>>>>
>>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
>>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};
>>>
>>>
>>> In my script the lines are:
>>>
>>> use mysql
>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass} ${ssl_options};
>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass} ${ssl_options};
>>> select * from user;
>>> flush privileges;
>>>
>>> Ups, I now see that a semicolon is missing after "use mysql".
>>> I'll add it and rerun the script:
>>> Oh it won't let me do the "use mysql;" Access denied.
>>
>>
>> Perhaps connect to mysql using the user name / password you have in the Catalog definition.
>
>
> [erik@Erik-PC ~]$ mysql bacula --user=bacula
> ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
> [erik@Erik-PC ~]$
>
> I am afraid it will never work :-(
>
It would work if you ran the grant privileges script - which you were
told to do way, way back.

        Cheers,
                Gary B-)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

andreas nastke
In reply to this post by Erik P. Olsen-3


Erik P. Olsen schrieb:

> On 2017-03-15 at 21:17:07 Dan Langille wrote:
>
>>> On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]> wrote:
>>>
>>> On 2017-03-13 at 22:52:04 Richard wrote:
>>>  
>>>> What you have for privileges is what I would expect. My
>>>> "grant_mysql_privileges" script has two lines - the first will do the
>>>> "localhost" setup for the bacula user. Assuming that your script is
>>>> lacking that, you might want to add it and try rerunning the script.
>>>>
>>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
>>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};  
>>>
>>> In my script the lines are:
>>>
>>> use mysql
>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass} ${ssl_options};
>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass} ${ssl_options};
>>> select * from user;
>>> flush privileges;
>>>
>>> Ups, I now see that a semicolon is missing after "use mysql".
>>> I'll add it and rerun the script:
>>> Oh it won't let me do the "use mysql;" Access denied.  
>>
>> Perhaps connect to mysql using the user name / password you have in the Catalog definition.
>
>
> [erik@Erik-PC ~]$ mysql bacula --user=bacula
> ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
> [erik@Erik-PC ~]$
>
> I am afraid it will never work :-(
>

does the user 'erik' has any privilege on the mysql engine?




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Richard
In reply to this post by Erik P. Olsen-3


> Date: Thursday, March 16, 2017 08:00:26 +0100
> From: "Erik P. Olsen" <[hidden email]>
>
> On 2017-03-15 at 21:17:07 Dan Langille wrote:
>
>> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
>> > wrote:
>> >
>> > On 2017-03-13 at 22:52:04 Richard wrote:
>> >  
>> >> What you have for privileges is what I would expect. My
>> >> "grant_mysql_privileges" script has two lines - the first will
>> >> do the "localhost" setup for the bacula user. Assuming that
>> >> your script is lacking that, you might want to add it and try
>> >> rerunning the script.
>> >>
>> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
>> >> ${pass}; grant all privileges on ${db_name}.* to ${db_user}@"%"
>> >> ${pass};  
>> >
>> >
>> > In my script the lines are:
>> >
>> > use mysql
>> > grant all privileges on ${db_name}.* to ${db_user}@localhost
>> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.* to
>> > ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
>> > flush privileges;
>> >
>> > Ups, I now see that a semicolon is missing after "use mysql".
>> > I'll add it and rerun the script:
>> > Oh it won't let me do the "use mysql;" Access denied.  
>>
>>
>> Perhaps connect to mysql using the user name / password you have
>> in the Catalog definition.
>
> [erik@Erik-PC ~]$ mysql bacula --user=bacula
> ERROR 1044 (42000): Access denied for user ''@'localhost' to
> database 'bacula' [erik@Erik-PC ~]$
>
> I am afraid it will never work :-(

>From the output you provided, the "grant" script that you are running
doesn't appear to be giving access permissions to bacula@localhost -
though seems to be for bacula@%. You might just want to look at the
bacula@% records and (manually) enter matching ones for
bacula@localhost. I suspect that that will at least get you on to the
next step.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by Gary R. Schmidt-3
On 2017-03-16 at 20:44:34 Gary R. Schmidt wrote:

> On 16/03/2017 18:00, Erik P. Olsen wrote:
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >  
> >>> On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]> wrote:
> >>>
> >>> On 2017-03-13 at 22:52:04 Richard wrote:
> >>>  
> >>>> What you have for privileges is what I would expect. My
> >>>> "grant_mysql_privileges" script has two lines - the first will do the
> >>>> "localhost" setup for the bacula user. Assuming that your script is
> >>>> lacking that, you might want to add it and try rerunning the script.
> >>>>
> >>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
> >>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};  
> >>>
> >>>
> >>> In my script the lines are:
> >>>
> >>> use mysql
> >>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass} ${ssl_options};
> >>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass} ${ssl_options};
> >>> select * from user;
> >>> flush privileges;
> >>>
> >>> Ups, I now see that a semicolon is missing after "use mysql".
> >>> I'll add it and rerun the script:
> >>> Oh it won't let me do the "use mysql;" Access denied.  
> >>
> >>
> >> Perhaps connect to mysql using the user name / password you have in the Catalog definition.  
> >
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
> > [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(
> >  
> It would work if you ran the grant privileges script - which you were
> told to do way, way back.

Which I did numerous times.

--
Erik

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by andreas nastke
On 2017-03-16 at 11:10:52 Andreas Nastke wrote:

> Erik P. Olsen schrieb:
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >  
> >>> On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]> wrote:
> >>>
> >>> On 2017-03-13 at 22:52:04 Richard wrote:
> >>>    
> >>>> What you have for privileges is what I would expect. My
> >>>> "grant_mysql_privileges" script has two lines - the first will do the
> >>>> "localhost" setup for the bacula user. Assuming that your script is
> >>>> lacking that, you might want to add it and try rerunning the script.
> >>>>
> >>>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
> >>>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};    
> >>>
> >>> In my script the lines are:
> >>>
> >>> use mysql
> >>> grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass} ${ssl_options};
> >>> grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass} ${ssl_options};
> >>> select * from user;
> >>> flush privileges;
> >>>
> >>> Ups, I now see that a semicolon is missing after "use mysql".
> >>> I'll add it and rerun the script:
> >>> Oh it won't let me do the "use mysql;" Access denied.    
> >>
> >> Perhaps connect to mysql using the user name / password you have in the Catalog definition.  
> >
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
> > [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(
> >  
>
> does the user 'erik' has any privilege on the mysql engine?
>

This is something I don't know how to see.

--
Erik


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by Richard
On 2017-03-16 at 11:10:10 Richard wrote:

> > Date: Thursday, March 16, 2017 08:00:26 +0100
> > From: "Erik P. Olsen" <[hidden email]>
> >
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >  
> >> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
> >> > wrote:
> >> >
> >> > On 2017-03-13 at 22:52:04 Richard wrote:
> >> >    
> >> >> What you have for privileges is what I would expect. My
> >> >> "grant_mysql_privileges" script has two lines - the first will
> >> >> do the "localhost" setup for the bacula user. Assuming that
> >> >> your script is lacking that, you might want to add it and try
> >> >> rerunning the script.
> >> >>
> >> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> >> ${pass}; grant all privileges on ${db_name}.* to ${db_user}@"%"
> >> >> ${pass};    
> >> >
> >> >
> >> > In my script the lines are:
> >> >
> >> > use mysql
> >> > grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.* to
> >> > ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
> >> > flush privileges;
> >> >
> >> > Ups, I now see that a semicolon is missing after "use mysql".
> >> > I'll add it and rerun the script:
> >> > Oh it won't let me do the "use mysql;" Access denied.    
> >>
> >>
> >> Perhaps connect to mysql using the user name / password you have
> >> in the Catalog definition.  
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to
> > database 'bacula' [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(  
>
> >From the output you provided, the "grant" script that you are running  
> doesn't appear to be giving access permissions to bacula@localhost -
> though seems to be for bacula@%. You might just want to look at the
> bacula@% records and (manually) enter matching ones for
> bacula@localhost. I suspect that that will at least get you on to the
> next step.

MariaDB [(none)]> grant all privileges on bacula.* to bacula@localhost;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
MariaDB [(none)]>

Apparently gets me nowhere.
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Wanderlei Huttel
Hello Erick

You must access with root user.
I've made some tests with Ubuntu 16.04 LTS and MariaDB and have some problems like yours.

I was only able to access the bconsole after changing the localhost catalog address setting to 127.0.01.

But I will try another thest with Ubuntu Server 16.04 LTS

Catalog {
   Name = MyCatalog
   Dbdriver = "dbi: mysql"
   Dbaddress = "localhost"
   Dbport = "3306"
   Dbname = "bacula"
   Dbuser = "bacula"
   Dbpassword = "bacula"
}



Best regards

Wanderlei Hüttel

2017-03-16 9:04 GMT-03:00 Erik P. Olsen <[hidden email]>:
On 2017-03-16 at 11:10:10 Richard wrote:

> > Date: Thursday, March 16, 2017 08:00:26 +0100
> > From: "Erik P. Olsen" <[hidden email]>
> >
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >
> >> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
> >> > wrote:
> >> >
> >> > On 2017-03-13 at 22:52:04 Richard wrote:
> >> >
> >> >> What you have for privileges is what I would expect. My
> >> >> "grant_mysql_privileges" script has two lines - the first will
> >> >> do the "localhost" setup for the bacula user. Assuming that
> >> >> your script is lacking that, you might want to add it and try
> >> >> rerunning the script.
> >> >>
> >> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> >> ${pass}; grant all privileges on ${db_name}.* to ${db_user}@"%"
> >> >> ${pass};
> >> >
> >> >
> >> > In my script the lines are:
> >> >
> >> > use mysql
> >> > grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.* to
> >> > ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
> >> > flush privileges;
> >> >
> >> > Ups, I now see that a semicolon is missing after "use mysql".
> >> > I'll add it and rerun the script:
> >> > Oh it won't let me do the "use mysql;" Access denied.
> >>
> >>
> >> Perhaps connect to mysql using the user name / password you have
> >> in the Catalog definition.
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to
> > database 'bacula' [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(
>
> >From the output you provided, the "grant" script that you are running
> doesn't appear to be giving access permissions to bacula@localhost -
> though seems to be for bacula@%. You might just want to look at the
> bacula@% records and (manually) enter matching ones for
> bacula@localhost. I suspect that that will at least get you on to the
> next step.

MariaDB [(none)]> grant all privileges on bacula.* to bacula@localhost;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
MariaDB [(none)]>

Apparently gets me nowhere.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Richard
In reply to this post by Erik P. Olsen-3


> Date: Thursday, March 16, 2017 13:04:24 +0100
> From: "Erik P. Olsen" <[hidden email]>
>
> On 2017-03-16 at 11:10:10 Richard wrote:
>
>> > Date: Thursday, March 16, 2017 08:00:26 +0100
>> > From: "Erik P. Olsen" <[hidden email]>
>> >
>> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
>> >  
>> >> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
>> >> > wrote:
>> >> >
>> >> > On 2017-03-13 at 22:52:04 Richard wrote:
>> >> >    
>> >> >> What you have for privileges is what I would expect. My
>> >> >> "grant_mysql_privileges" script has two lines - the first
>> >> >> will do the "localhost" setup for the bacula user. Assuming
>> >> >> that your script is lacking that, you might want to add it
>> >> >> and try rerunning the script.
>> >> >>
>> >> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
>> >> >> ${pass}; grant all privileges on ${db_name}.* to
>> >> >> ${db_user}@"%" ${pass};    
>> >> >
>> >> >
>> >> > In my script the lines are:
>> >> >
>> >> > use mysql
>> >> > grant all privileges on ${db_name}.* to ${db_user}@localhost
>> >> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.*
>> >> > to ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
>> >> > flush privileges;
>> >> >
>> >> > Ups, I now see that a semicolon is missing after "use mysql".
>> >> > I'll add it and rerun the script:
>> >> > Oh it won't let me do the "use mysql;" Access denied.    
>> >>
>> >>
>> >> Perhaps connect to mysql using the user name / password you have
>> >> in the Catalog definition.  
>> >
>> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
>> > ERROR 1044 (42000): Access denied for user ''@'localhost' to
>> > database 'bacula'
>> >
>> > I am afraid it will never work :-(  
>>
>> > From the output you provided, the "grant" script that you are
>> > running  
>> doesn't appear to be giving access permissions to bacula@localhost
>> - though seems to be for bacula@%. You might just want to look at
>> the bacula@% records and (manually) enter matching ones for
>> bacula@localhost. I suspect that that will at least get you on to
>> the next step.
>
> MariaDB [(none)]> grant all privileges on bacula.* to
> bacula@localhost; ERROR 1044 (42000): Access denied for user
> ''@'localhost' to database 'bacula'
>
> Apparently gets me nowhere.
>  

You need to be mysql/mariadb or system root to do that (or at least
identified as a user with "grant" privileges). Also, you don't appear
to have a database selected, hence the '[(none)]' on the prompt.
Note, the initial tables that you need to effect are mysql.user and
mysql.db. Look at the records for the bacula@% entries for templates
of what is needed. I would probably [mysql]dump the records from the
various mysql db tables, change the '%' to 'localhost' on the bacula
user ones, remove the other records (and create statements, if you
included them) and then load the resulting ones in.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Josh Fisher
In reply to this post by Wanderlei Huttel

On 3/16/2017 8:18 AM, Wanderlei Huttel wrote:
Hello Erick

You must access with root user.
I've made some tests with Ubuntu 16.04 LTS and MariaDB and have some problems like yours.

I was only able to access the bconsole after changing the localhost catalog address setting to 127.0.01.

When the DNS lookup is made (probably a getaddrinfo() call) without a specified protocol, all addresses for all protocols are returned. Bacula would then choose one, likely the first one found. I'm not familiar with 16.04 LTS, but on most Linux systems, an IPv6 address will precede an IPv4 address. Also on most systems, both protocols are enabled and the name "localhost" is both 127.0.0.1 and ::1.

Is MariaDB configured to listen on ::1?

Can you access the bconsole when Dbaddress = ::1?


But I will try another thest with Ubuntu Server 16.04 LTS

Catalog {
   Name = MyCatalog
   Dbdriver = "dbi: mysql"
   Dbaddress = "localhost"
   Dbport = "3306"
   Dbname = "bacula"
   Dbuser = "bacula"
   Dbpassword = "bacula"
}



Best regards

Wanderlei Hüttel

2017-03-16 9:04 GMT-03:00 Erik P. Olsen <[hidden email]>:
On 2017-03-16 at 11:10:10 Richard wrote:

> > Date: Thursday, March 16, 2017 08:00:26 +0100
> > From: "Erik P. Olsen" <[hidden email]>
> >
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >
> >> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
> >> > wrote:
> >> >
> >> > On 2017-03-13 at 22:52:04 Richard wrote:
> >> >
> >> >> What you have for privileges is what I would expect. My
> >> >> "grant_mysql_privileges" script has two lines - the first will
> >> >> do the "localhost" setup for the bacula user. Assuming that
> >> >> your script is lacking that, you might want to add it and try
> >> >> rerunning the script.
> >> >>
> >> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> >> ${pass}; grant all privileges on ${db_name}.* to ${db_user}@"%"
> >> >> ${pass};
> >> >
> >> >
> >> > In my script the lines are:
> >> >
> >> > use mysql
> >> > grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.* to
> >> > ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
> >> > flush privileges;
> >> >
> >> > Ups, I now see that a semicolon is missing after "use mysql".
> >> > I'll add it and rerun the script:
> >> > Oh it won't let me do the "use mysql;" Access denied.
> >>
> >>
> >> Perhaps connect to mysql using the user name / password you have
> >> in the Catalog definition.
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to
> > database 'bacula' [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(
>
> >From the output you provided, the "grant" script that you are running
> doesn't appear to be giving access permissions to bacula@localhost -
> though seems to be for bacula@%. You might just want to look at the
> bacula@% records and (manually) enter matching ones for
> bacula@localhost. I suspect that that will at least get you on to the
> next step.

MariaDB [(none)]> grant all privileges on bacula.* to bacula@localhost;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
MariaDB [(none)]>

Apparently gets me nowhere.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Wanderlei Huttel
Hello Josh

I'm uploading a new server:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

I will do the test


Best Regards

Wanderlei Hüttel

2017-03-16 10:13 GMT-03:00 Josh Fisher <[hidden email]>:

On 3/16/2017 8:18 AM, Wanderlei Huttel wrote:
Hello Erick

You must access with root user.
I've made some tests with Ubuntu 16.04 LTS and MariaDB and have some problems like yours.

I was only able to access the bconsole after changing the localhost catalog address setting to 127.0.01.

When the DNS lookup is made (probably a getaddrinfo() call) without a specified protocol, all addresses for all protocols are returned. Bacula would then choose one, likely the first one found. I'm not familiar with 16.04 LTS, but on most Linux systems, an IPv6 address will precede an IPv4 address. Also on most systems, both protocols are enabled and the name "localhost" is both 127.0.0.1 and ::1.

Is MariaDB configured to listen on ::1?

Can you access the bconsole when Dbaddress = ::1?



But I will try another thest with Ubuntu Server 16.04 LTS

Catalog {
   Name = MyCatalog
   Dbdriver = "dbi: mysql"
   Dbaddress = "localhost"
   Dbport = "3306"
   Dbname = "bacula"
   Dbuser = "bacula"
   Dbpassword = "bacula"
}



Best regards

Wanderlei Hüttel

2017-03-16 9:04 GMT-03:00 Erik P. Olsen <[hidden email]>:
On 2017-03-16 at 11:10:10 Richard wrote:

> > Date: Thursday, March 16, 2017 08:00:26 +0100
> > From: "Erik P. Olsen" <[hidden email]>
> >
> > On 2017-03-15 at 21:17:07 Dan Langille wrote:
> >
> >> > On Mar 14, 2017, at 2:42 AM, Erik P. Olsen <[hidden email]>
> >> > wrote:
> >> >
> >> > On 2017-03-13 at 22:52:04 Richard wrote:
> >> >
> >> >> What you have for privileges is what I would expect. My
> >> >> "grant_mysql_privileges" script has two lines - the first will
> >> >> do the "localhost" setup for the bacula user. Assuming that
> >> >> your script is lacking that, you might want to add it and try
> >> >> rerunning the script.
> >> >>
> >> >> grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> >> ${pass}; grant all privileges on ${db_name}.* to ${db_user}@"%"
> >> >> ${pass};
> >> >
> >> >
> >> > In my script the lines are:
> >> >
> >> > use mysql
> >> > grant all privileges on ${db_name}.* to ${db_user}@localhost
> >> > ${pass} ${ssl_options};  grant all privileges on ${db_name}.* to
> >> > ${db_user}@"%" ${pass} ${ssl_options};  select * from user;
> >> > flush privileges;
> >> >
> >> > Ups, I now see that a semicolon is missing after "use mysql".
> >> > I'll add it and rerun the script:
> >> > Oh it won't let me do the "use mysql;" Access denied.
> >>
> >>
> >> Perhaps connect to mysql using the user name / password you have
> >> in the Catalog definition.
> >
> > [erik@Erik-PC ~]$ mysql bacula --user=bacula
> > ERROR 1044 (42000): Access denied for user ''@'localhost' to
> > database 'bacula' [erik@Erik-PC ~]$
> >
> > I am afraid it will never work :-(
>
> >From the output you provided, the "grant" script that you are running
> doesn't appear to be giving access permissions to bacula@localhost -
> though seems to be for bacula@%. You might just want to look at the
> bacula@% records and (manually) enter matching ones for
> bacula@localhost. I suspect that that will at least get you on to the
> next step.

MariaDB [(none)]> grant all privileges on bacula.* to bacula@localhost;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'
MariaDB [(none)]>

Apparently gets me nowhere.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't run bacula any more.

Dimitri Maziuk
In reply to this post by Erik P. Olsen-3
On 2017-03-16 02:00, Erik P. Olsen wrote:

> I am afraid it will never work :-(

I'd've given up and installed postgress long time ago myself.

Dima




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[END OF THREAD]Re: Can't run bacula any more.

Erik P. Olsen-3
In reply to this post by Wanderlei Huttel
Hello everybody,

I would like to express my gratitude to all you nice guys who so patiently have provided many good
advice. I really do appreciate your effort. However, no matter have good these advice were I have
not been able to get bacula going on this system. I do believe that I have issued all necessary
commands and scripts more than once and that they should work. The problem lies probably in either
mariadb or the database files which probably are corrupt.

I have not given up but I will concentrate on getting mariadb correctly installed and see if this
approach will be profitable.

--
Erik

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Heitor Faria

> Hello everybody,

Hello, Erik,

> I would like to express my gratitude to all you nice guys who so patiently have
> provided many good
> advice. I really do appreciate your effort. However, no matter have good these
> advice were I have
> not been able to get bacula going on this system. I do believe that I have
> issued all necessary
> commands and scripts more than once and that they should work. The problem lies
> probably in either
> mariadb or the database files which probably are corrupt.

Particulary I don't like to be tied to packages versions and prefer to build Bacula from source (ref.: http://bacula.us/compilation/). Perhaps you might give a try.

> I have not given up but I will concentrate on getting mariadb correctly
> installed and see if this
> approach will be profitable.
>
> --
> Erik

Regards,
--
===========================================================================
Heitor Medrado de Faria | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/ 
• Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/ 
(61) 98268-4220 | www.bacula.com.br
============================================================================
Indicamos também as capacitações complementares:
• Shell básico e Programação em Shell com Julio Neves.
• Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Wanderlei Huttel
In reply to this post by Erik P. Olsen-3
Hello Erick

I have a tutorial in portuguese that I've updated.
I've tryied with MariaDB and worked. If you want to try.
I used Ubuntu or Debian. 

Best regards

Wanderlei Hüttel

2017-03-17 17:32 GMT-03:00 Erik P. Olsen <[hidden email]>:
Hello everybody,

I would like to express my gratitude to all you nice guys who so patiently have provided many good
advice. I really do appreciate your effort. However, no matter have good these advice were I have
not been able to get bacula going on this system. I do believe that I have issued all necessary
commands and scripts more than once and that they should work. The problem lies probably in either
mariadb or the database files which probably are corrupt.

I have not given up but I will concentrate on getting mariadb correctly installed and see if this
approach will be profitable.

--
Erik

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Josip Deanovic
In reply to this post by Erik P. Olsen-3
On Friday 2017-03-17 21:32:13 Erik P. Olsen wrote:

> Hello everybody,
>
> I would like to express my gratitude to all you nice guys who so
> patiently have provided many good advice. I really do appreciate your
> effort. However, no matter have good these advice were I have not been
> able to get bacula going on this system. I do believe that I have
> issued all necessary commands and scripts more than once and that they
> should work. The problem lies probably in either mariadb or the
> database files which probably are corrupt.
>
> I have not given up but I will concentrate on getting mariadb correctly
> installed and see if this approach will be profitable.


I will try to recap the whole mysql story you might miss since
you said that you do not have any previous database experience.

- mysql default port is 3306
- mysql can listen on the localhost (in mysql terminology that would
  mean unix socket), 127.0.0.1 or any other IP (be it ipv4 or ipv6)
  which is setup in the mysql main configuration file
- for mysql localhost and 127.0.0.1 IS NOT THE SAME THING
- one can setup some root password for mysql root user (very good idea)
  but for the purposes of testing the setup it is not necessary
- if the password for the mysql root user is set one should always
  either use -p option (when connection as mysql root user to the mysql
  server) on the command line to instruct the mysql client tool that it
  needs to prompt for a mysql root password or as an alternative a
  file /root/.my.cnf should be created that looks like:
  [client]
  # use either localhost or 127.0.0.1 depending on how your mysql
  # server is being configured in the main mysql configuration file
  host=localhost
  user=root
  password="some_very_strong_password"
- at this point no matter whether the mysql root password is set or
  not, system root user will always be able to connect to the mysql
  server using simple mysql command
- one can use "netstat -lnp | grep 3306" to determine if the
  mysql server is listening on some IP or just on the unix socket
- only if mysql server has been configured to listen on 127.0.0.1
  one can use the option "-h 127.0.0.1" to connect to the mysql
  server using mysql client tool.
- mysql server contains mysql database which contains several tables
  needed for its normal operation
- once connected to the mysql server as mysql root user, one can
  use the command "show database" to list the available databases,
  the command "use <some database>" to enter the specified database,
  the command "show tables" to list the tables in the database we
  have entered and so on
- mysql database contains two very important tables (among others):
  user
  db
- the SQL command "select * from mysql.user" would list the whole
  content of the "user" table in the mysql database and it can be
  used to determine if the target user exist and from what hosts
  it should be able to connect
- pretty much the same goes for the mysql.db table
- at this point it would be the best if the both, localhost and
  127.0.0.1 are allowed to connect to the server and to the target
  database (in our case most probably "bacula")
- in mysql if the table in the mysql has been changed manually using
  SQL commands, a command "flush privileges;" has to be issued in
  order for mysql to apply the changes (some mysql commands also
  require flushing privileges), alternatively a mysql server can
  be restarted


So, when setting up the mysql database for use with mysql the
path would be:

1. install the mysql
2. set up the root password and flush privileges or restart the
   mysql server (lame)
3. configure the mysql as you see fit, chose the port and the
   IP/socket it is going to bind/listen and restart the mysql
   server
4. set up the /root/.my.cnf file in accordance to the configuration
   options you have used in step 3.
5. make sure your firewall will not block your mysql connections
6. test mysql connections manually using commands:
   mysql -h localhost -u root -p
   (of course, if you have used 127.0.0.1 you will use that instead
   of localhost)
7. if successful in step 6 we can go to the directory containing
   files:
     create_mysql_database
     make_mysql_tables
     grant_mysql_privileges
   and as a system root user execute them in that order
8. if successful in step 7, set some strong password for the
   bacula user (similarly to the changing password of the mysql
   root user) and do the "flush privileges;" as mysql root user or
   restart the mysql server
9. test the connection manually (in this example I am using mysql
   user "bacula" and the database "bacula" while -p means that
   mysql client tool should prompt for the password):
   mysql -h localhost -u bacula -p bacula
10. if successful in step 9, setup the catalog database connection
   in the bacula-dir.conf like:
   dbname = "bacula"; dbuser = "bacula"; dbpassword = "some_strong_pass";
dbaddress = "localhost"
   note that the dbaddress should reflect your mysql setup (so if it's
   configured to bind to 127.0.0.1, use 127.0.0.1, if it's something
   else, use something else
11. test the bacula-dir configuration using the command:
  bacula-dir -t
12. restart the bacula-dir and check if it's running using the command:
  ps aux | grep bacula-dir
13. connect to the bacula-dir using your bconsole tool
14. if step 13 failes, check everything, check system logs, check bacula
   logs, check mysql logs, do the connection tests one more time, debug...


It's pretty strait forward (this is not a sarcasm).

If you are using hostnames instead of IPs then you should make sure
that
- mysql has been setup to support that
- that the host resolves to the IP you believe it should

For the purpose of debugging it would be a good idea to turn off
everything that could stand in the way, e.g. firewall, selinux.


--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Erik P. Olsen-3
On 2017-03-18 at 04:11:19 Josip Deanovic wrote:

> On Friday 2017-03-17 21:32:13 Erik P. Olsen wrote:
> > Hello everybody,
> >
> > I would like to express my gratitude to all you nice guys who so
> > patiently have provided many good advice. I really do appreciate your
> > effort. However, no matter have good these advice were I have not been
> > able to get bacula going on this system. I do believe that I have
> > issued all necessary commands and scripts more than once and that they
> > should work. The problem lies probably in either mariadb or the
> > database files which probably are corrupt.
> >
> > I have not given up but I will concentrate on getting mariadb correctly
> > installed and see if this approach will be profitable.  
>
>
> I will try to recap the whole mysql story you might miss since
> you said that you do not have any previous database experience.
>
> - mysql default port is 3306
> - mysql can listen on the localhost (in mysql terminology that would
>   mean unix socket), 127.0.0.1 or any other IP (be it ipv4 or ipv6)
>   which is setup in the mysql main configuration file
> - for mysql localhost and 127.0.0.1 IS NOT THE SAME THING
> - one can setup some root password for mysql root user (very good idea)
>   but for the purposes of testing the setup it is not necessary
> - if the password for the mysql root user is set one should always
>   either use -p option (when connection as mysql root user to the mysql
>   server) on the command line to instruct the mysql client tool that it
>   needs to prompt for a mysql root password or as an alternative a
>   file /root/.my.cnf should be created that looks like:
>   [client]
>   # use either localhost or 127.0.0.1 depending on how your mysql
>   # server is being configured in the main mysql configuration file
>   host=localhost
>   user=root
>   password="some_very_strong_password"
> - at this point no matter whether the mysql root password is set or
>   not, system root user will always be able to connect to the mysql
>   server using simple mysql command
> - one can use "netstat -lnp | grep 3306" to determine if the
>   mysql server is listening on some IP or just on the unix socket
> - only if mysql server has been configured to listen on 127.0.0.1
>   one can use the option "-h 127.0.0.1" to connect to the mysql
>   server using mysql client tool.
> - mysql server contains mysql database which contains several tables
>   needed for its normal operation
> - once connected to the mysql server as mysql root user, one can
>   use the command "show database" to list the available databases,
>   the command "use <some database>" to enter the specified database,
>   the command "show tables" to list the tables in the database we
>   have entered and so on
> - mysql database contains two very important tables (among others):
>   user
>   db
> - the SQL command "select * from mysql.user" would list the whole
>   content of the "user" table in the mysql database and it can be
>   used to determine if the target user exist and from what hosts
>   it should be able to connect
> - pretty much the same goes for the mysql.db table
> - at this point it would be the best if the both, localhost and
>   127.0.0.1 are allowed to connect to the server and to the target
>   database (in our case most probably "bacula")
> - in mysql if the table in the mysql has been changed manually using
>   SQL commands, a command "flush privileges;" has to be issued in
>   order for mysql to apply the changes (some mysql commands also
>   require flushing privileges), alternatively a mysql server can
>   be restarted
>
>
> So, when setting up the mysql database for use with mysql the
> path would be:
>
> 1. install the mysql
> 2. set up the root password and flush privileges or restart the
>    mysql server (lame)
> 3. configure the mysql as you see fit, chose the port and the
>    IP/socket it is going to bind/listen and restart the mysql
>    server
> 4. set up the /root/.my.cnf file in accordance to the configuration
>    options you have used in step 3.
> 5. make sure your firewall will not block your mysql connections
> 6. test mysql connections manually using commands:
>    mysql -h localhost -u root -p
>    (of course, if you have used 127.0.0.1 you will use that instead
>    of localhost)
> 7. if successful in step 6 we can go to the directory containing
>    files:
>      create_mysql_database
>      make_mysql_tables
>      grant_mysql_privileges
>    and as a system root user execute them in that order
> 8. if successful in step 7, set some strong password for the
>    bacula user (similarly to the changing password of the mysql
>    root user) and do the "flush privileges;" as mysql root user or
>    restart the mysql server
> 9. test the connection manually (in this example I am using mysql
>    user "bacula" and the database "bacula" while -p means that
>    mysql client tool should prompt for the password):
>    mysql -h localhost -u bacula -p bacula
> 10. if successful in step 9, setup the catalog database connection
>    in the bacula-dir.conf like:
>    dbname = "bacula"; dbuser = "bacula"; dbpassword = "some_strong_pass";
> dbaddress = "localhost"
>    note that the dbaddress should reflect your mysql setup (so if it's
>    configured to bind to 127.0.0.1, use 127.0.0.1, if it's something
>    else, use something else
> 11. test the bacula-dir configuration using the command:
>   bacula-dir -t
> 12. restart the bacula-dir and check if it's running using the command:
>   ps aux | grep bacula-dir
> 13. connect to the bacula-dir using your bconsole tool
> 14. if step 13 failes, check everything, check system logs, check bacula
>    logs, check mysql logs, do the connection tests one more time, debug...
>
>
> It's pretty strait forward (this is not a sarcasm).
>
> If you are using hostnames instead of IPs then you should make sure
> that
> - mysql has been setup to support that
> - that the host resolves to the IP you believe it should
>
> For the purpose of debugging it would be a good idea to turn off
> everything that could stand in the way, e.g. firewall, selinux.
>
>

 
Thanks a lot.

--
Erik

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Josip Deanovic
On Saturday 2017-03-18 09:10:32 Erik P. Olsen wrote:
> Thanks a lot.

Thank me if you actually make it work. :-)

--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Kern Sibbald
In reply to this post by Erik P. Olsen-3
Hello,

I would make only one note to the procedure below: if your Director and
the MySQL database are on the same machine, it is probably more
efficient to use the default installation that uses the Unix socket.

Best regards,

Kern


On 03/18/2017 09:10 AM, Erik P. Olsen wrote:

> On 2017-03-18 at 04:11:19 Josip Deanovic wrote:
>
>> On Friday 2017-03-17 21:32:13 Erik P. Olsen wrote:
>>> Hello everybody,
>>>
>>> I would like to express my gratitude to all you nice guys who so
>>> patiently have provided many good advice. I really do appreciate your
>>> effort. However, no matter have good these advice were I have not been
>>> able to get bacula going on this system. I do believe that I have
>>> issued all necessary commands and scripts more than once and that they
>>> should work. The problem lies probably in either mariadb or the
>>> database files which probably are corrupt.
>>>
>>> I have not given up but I will concentrate on getting mariadb correctly
>>> installed and see if this approach will be profitable.
>>
>> I will try to recap the whole mysql story you might miss since
>> you said that you do not have any previous database experience.
>>
>> - mysql default port is 3306
>> - mysql can listen on the localhost (in mysql terminology that would
>>    mean unix socket), 127.0.0.1 or any other IP (be it ipv4 or ipv6)
>>    which is setup in the mysql main configuration file
>> - for mysql localhost and 127.0.0.1 IS NOT THE SAME THING
>> - one can setup some root password for mysql root user (very good idea)
>>    but for the purposes of testing the setup it is not necessary
>> - if the password for the mysql root user is set one should always
>>    either use -p option (when connection as mysql root user to the mysql
>>    server) on the command line to instruct the mysql client tool that it
>>    needs to prompt for a mysql root password or as an alternative a
>>    file /root/.my.cnf should be created that looks like:
>>    [client]
>>    # use either localhost or 127.0.0.1 depending on how your mysql
>>    # server is being configured in the main mysql configuration file
>>    host=localhost
>>    user=root
>>    password="some_very_strong_password"
>> - at this point no matter whether the mysql root password is set or
>>    not, system root user will always be able to connect to the mysql
>>    server using simple mysql command
>> - one can use "netstat -lnp | grep 3306" to determine if the
>>    mysql server is listening on some IP or just on the unix socket
>> - only if mysql server has been configured to listen on 127.0.0.1
>>    one can use the option "-h 127.0.0.1" to connect to the mysql
>>    server using mysql client tool.
>> - mysql server contains mysql database which contains several tables
>>    needed for its normal operation
>> - once connected to the mysql server as mysql root user, one can
>>    use the command "show database" to list the available databases,
>>    the command "use <some database>" to enter the specified database,
>>    the command "show tables" to list the tables in the database we
>>    have entered and so on
>> - mysql database contains two very important tables (among others):
>>    user
>>    db
>> - the SQL command "select * from mysql.user" would list the whole
>>    content of the "user" table in the mysql database and it can be
>>    used to determine if the target user exist and from what hosts
>>    it should be able to connect
>> - pretty much the same goes for the mysql.db table
>> - at this point it would be the best if the both, localhost and
>>    127.0.0.1 are allowed to connect to the server and to the target
>>    database (in our case most probably "bacula")
>> - in mysql if the table in the mysql has been changed manually using
>>    SQL commands, a command "flush privileges;" has to be issued in
>>    order for mysql to apply the changes (some mysql commands also
>>    require flushing privileges), alternatively a mysql server can
>>    be restarted
>>
>>
>> So, when setting up the mysql database for use with mysql the
>> path would be:
>>
>> 1. install the mysql
>> 2. set up the root password and flush privileges or restart the
>>     mysql server (lame)
>> 3. configure the mysql as you see fit, chose the port and the
>>     IP/socket it is going to bind/listen and restart the mysql
>>     server
>> 4. set up the /root/.my.cnf file in accordance to the configuration
>>     options you have used in step 3.
>> 5. make sure your firewall will not block your mysql connections
>> 6. test mysql connections manually using commands:
>>     mysql -h localhost -u root -p
>>     (of course, if you have used 127.0.0.1 you will use that instead
>>     of localhost)
>> 7. if successful in step 6 we can go to the directory containing
>>     files:
>>       create_mysql_database
>>       make_mysql_tables
>>       grant_mysql_privileges
>>     and as a system root user execute them in that order
>> 8. if successful in step 7, set some strong password for the
>>     bacula user (similarly to the changing password of the mysql
>>     root user) and do the "flush privileges;" as mysql root user or
>>     restart the mysql server
>> 9. test the connection manually (in this example I am using mysql
>>     user "bacula" and the database "bacula" while -p means that
>>     mysql client tool should prompt for the password):
>>     mysql -h localhost -u bacula -p bacula
>> 10. if successful in step 9, setup the catalog database connection
>>     in the bacula-dir.conf like:
>>     dbname = "bacula"; dbuser = "bacula"; dbpassword = "some_strong_pass";
>> dbaddress = "localhost"
>>     note that the dbaddress should reflect your mysql setup (so if it's
>>     configured to bind to 127.0.0.1, use 127.0.0.1, if it's something
>>     else, use something else
>> 11. test the bacula-dir configuration using the command:
>>    bacula-dir -t
>> 12. restart the bacula-dir and check if it's running using the command:
>>    ps aux | grep bacula-dir
>> 13. connect to the bacula-dir using your bconsole tool
>> 14. if step 13 failes, check everything, check system logs, check bacula
>>     logs, check mysql logs, do the connection tests one more time, debug...
>>
>>
>> It's pretty strait forward (this is not a sarcasm).
>>
>> If you are using hostnames instead of IPs then you should make sure
>> that
>> - mysql has been setup to support that
>> - that the host resolves to the IP you believe it should
>>
>> For the purpose of debugging it would be a good idea to turn off
>> everything that could stand in the way, e.g. firewall, selinux.
>>
>>
>  
> Thanks a lot.
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [END OF THREAD]Re: Can't run bacula any more.

Josip Deanovic
On Saturday 2017-03-18 14:19:45 Kern Sibbald wrote:
> Hello,
>
> I would make only one note to the procedure below: if your Director and
> the MySQL database are on the same machine, it is probably more
> efficient to use the default installation that uses the Unix socket.


And I need to point to a typo I did:
It's not "show database" but "show databases;"

--
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
1234
Loading...