CentOS 5
Sponsored Link

Create Database2010/05/03

  When installing Bacula-mysql on Bacula server, installer tries to create Bacula user and database on MySQL, but those are failed becasue MySQL's root user's password is not empty, so it's neccessary to create database for Bacula on MySQL manually.

[1] Create database for Bacula on MySQL. Please replace '/usr/lib64/***' to '/usr/lib/***' if you use 32 bit version.
[root@dlp ~]#
vi /usr/lib64/bacula/grant_mysql_privileges


# line 9: change

if $bindir/mysql $* -u root
-p
 <<END-OF-DATA

[root@dlp ~]#
vi /usr/lib64/bacula/create_mysql_database


# line 9: change

if $bindir/mysql $*
-p
 <<END-OF-DATA

[root@dlp ~]#
vi /usr/lib64/bacula/make_mysql_tables


# line 7: change

if $bindir/mysql $*
-p
 <<END-OF-DATA

[root@dlp ~]#
/usr/lib64/bacula/grant_mysql_privileges

Enter password:
Privileges for bacula granted on bacula.
[root@dlp ~]#
/usr/lib64/bacula/create_mysql_database

Enter password:
Creation of bacula database succeeded.
[root@dlp ~]#
/usr/lib64/bacula/make_mysql_tables

Enter password:
Creation of Bacula MySQL tables succeeded.
[root@dlp ~]#
mysql -u root -p
# login MySQL

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

# set bacula's password

mysql>
set password for bacula=password('password');

Query OK, 0 rows affected (0.00 sec)

mysql>
set password for bacula@localhost=password('password');

Query OK, 0 rows affected (0.00 sec)

# verify settings

mysql>
select user,host,password from mysql.user;

5 rows in set (0.00 sec)

mysql>
show databases;

3 rows in set (0.00 sec)

mysql>
use bacula;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
show tables;

22 rows in set (0.00 sec)

mysql>
exit

Bye
Matched Content