On Monday, 27 December 2021 12:34:32 GMT Josip Deanovic wrote:
> On 2021-12-27 12:55, Graham Dicker wrote:
> > I tried (while running mysql as root)
> > MariaDB [(none)]> UPDATE mysql.db SET Host='localhost' WHERE
> > User='bacula';
> > 
> > that worked OK
> > 
> > but this didn't
> > 
> > MariaDB [(none)]> UPDATE mysql.user SET Host='localhost' WHERE
> > User='bacula';
> > ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or
> > column(s) or
> > function(s) or definer/invoker of view lack rights to use them
> > 
> > I'm sure Bacula never used to involve this much mucking about! The
> > configure and build
> > process used to take care of all this didn't it?
> 
> But this is not about bacula, this is about basic mysql administration.
> Bacula is completely innocent here. :-)
> 
> So, what you need to do is to start mysql service as usual and
> connect to that mysql instance as user root.
> 
> If you cannot connet to that mysql instance like this:
> mysql -u root
> ... then this is another problem (assuming you didn't setup
> root password already).
> 
> 
> After you connect to the correct mysql instance as root, you
> will be able to "enter" the database you need which is in this
> case "mysql" database so you would need to issue this command:
> "use mysql;"
> 
> After that you would need to perform update you already tried:
> "update user set Host='localhost' where User='bacula';"
> And after that you would need to issue the command "flush privileges;"
> which is in this case necessary because you are modifying
> data on the mysql system tables.
> 
> Instead of all of the above, you could just add bacula user in
> mysql client like this:
> CREATE USER 'bacula'@'localhost' IDENTIFIED BY 'your password';
> 
> Then you could create bacula database using the command in
> mysql client:
> "create database if not exists bacula;"
> 
> After that you would need to use the GRANT command mentioned in
> previous posts. The purpose of GRANT command is to give privileges
> over the "bacula" mysql database to the "bacula" mysql user.
> 
> When this is done, you should be able to connect as user
> "bacula" to the database "bacula" using mysql client like this:
> mysql -h localhost -u bacula -p bacula
> 
> After that, you should be able to import your bacula data into
> the bacula database using mysql client like this:
> mysql -h localhost -u bacula -p bacula < bacula_db_backup.sql
> 
> The only thing left to would be to update your bacula-dir.conf
> accordingly and that's it.
> 
> 
> Note that for mysql client there is a difference between localhost
> and 127.0.0.1.
> Localhost means that the client will be using unix socket whereas
> the 127.0.0.1 will instruct the mysql client to open TCP connection
> to 127.0.0.1:3306 (by default).
> 
> 
> Apologies for typos if there are any, I am writing in a hurry.
> 
> 
> Regards!

Sorry about copy and paste problems. Copy and paste from console window to 
KMail does not work. Here is what it should have said:

I can't get those commands to work

MariaDB [mysql]> CREATE USER 'bacula'@'localhost' IDENTIFIED BY 'xxx';
ERROR 1396 (HY000): Operation CREATE USER failed for 'bacula'@'localhost'
MariaDB [mysql]> UPDATE mysql.user SET Host='localhost' WHERE User='bacula';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) 
or function(s) or definer/invoker of view lack rights to use them

If I change the Catalog definition from

dbname = "bacula"; dbuser = "bacula"; dbpassword = ""

to

dbname = "bacula"; dbuser = "root"; dbpassword = ""

then Bacula does work but it doesn't "see" the volumes already in the database 
and wants 
to create new ones when I try to run a backup.

Graham






_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to