Bacula-users

Re: [Bacula-users] Problem connecting to catalog database (Mysql)

2010-08-15 09:30:06
Subject: Re: [Bacula-users] Problem connecting to catalog database (Mysql)
From: Dan Langille <dan AT langille DOT org>
To: bacula-users AT lists.sourceforge DOT net
Date: Sun, 15 Aug 2010 09:25:37 -0400
On 8/14/2010 3:58 PM, LasseKongo wrote:
> Hi!
> I am trying do do my first installation of Bacula 5.0.2, but I am running 
> into trouble with the connection between bacula-dir and Mysql.
> I tried running bacula-dir with debug:
>
> backup:~ # /opt/bacula-5.0.2/sbin/bacula-dir -d 100 -f
> bacula-dir: dird.c:184-0 Debug level = 100
> bacula-dir: bsys.c:511-0 Could not open state file. sfd=-1 size=192: ERR=No 
> such file or directory
> bacula-dir: mysql.c:100-0 db_open first time
> bacula-dir: mysql.c:129-0 initdb ref=1 connected=0 db=0
> bacula-dir: mysql.c:165-0 mysql_init done
> bacula-dir: mysql.c:186-0 mysql_real_connect done
> bacula-dir: mysql.c:188-0 db_user=bacula db_name=bacula 
> db_password=XXXXXXXXXXX
> bacula-dir: mysql.c:198-0 Error 2002 (HY000): Can't connect to local MySQL 
> server through socket '/var/run/mysql/mysql.sock' (2)
> bacula-dir: dird.c:950 Could not open Catalog "MyCatalog", database "bacula".
> bacula-dir: dird.c:955 mysql.c:194 Unable to connect to MySQL server.
> Database=bacula User=bacula
> MySQL connect failed either server not running or your authorization is 
> incorrect.
> bacula-dir: mysql.c:235-0 closedb ref=0 connected=0 db=0
> 14-Aug 21:26 bacula-dir ERROR TERMINATION
> Please correct configuration file: bacula-dir.conf
>
> I think the problem are the socket file above. I have configured the Mysql 
> server as a Mysql multi installation to be able to run several Mysql 
> instances, which means I am not using the default socket file.
>
> The relevant part of my my.cnf:

Your my.cnf?

You probably want this to be bacula's my.cf don't you?

>
> [mysqld1]
> port       = 3306
> datadir    = /mysql/bacula
> pid-file   = /var/lib/mysql/mysqld1.pid
> socket     = /var/lib/mysql/mysqld1.sock
> user       = mysql


>
> The catalog configuration from bacula-dir.conf:
>
> # Generic catalog service
> Catalog {
>    Name = MyCatalog
> # Uncomment the following line if you want the dbi driver
> # dbdriver = "dbi:mysql"; dbaddress = 127.0.0.1; dbport = 3306
>    dbname = "bacula"
>    dbuser = "bacula"
>    dbpassword = "XXXXXXXXX"
> }

Did you create the Bacula database?

http://www.bacula.org/manuals/en/catalog/catalog/Installing_Configurin_MySQL.html#SECTION00320000000000000000

Did you run the database creation script provided with Bacula?

>
> Is it possible to configure the bacula-dir to use a non standard socket file 
> or even better, to connect over tcp ?

Yes.  And Yes.

http://www.bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#SECTION0018160000000000000000

Look for DB Address & DB Port (which you can also see above in your 
Catalog configuration.




>
> +----------------------------------------------------------------------
> |This was sent by subscribe AT unix.no-ip DOT org via Backup Central.
> |Forward SPAM to abuse AT backupcentral DOT com.
> +----------------------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


-- 
Dan Langille - http://langille.org/

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>