Solved

Mysql database configuration for Bugzilla

Posted on 2006-10-30
26
554 Views
Last Modified: 2008-01-09
Hi,
I am getting the error while running checksetup.pl for a bugzilla installation.



Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
DBI connect(';localhost;3306','mysql',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at ./checksetup.pl line 1434
Can't connect to the mysql database. Is the database installed and
up and running?  Do you have the correct username and password selected in
localconfig?


The script uses a file localconfig to login the mysql database and perform some tests.

The username/password given in the config file are mysql/mysql.

But if I use mysql -u mysql -p
password:mysql
I can login the database.

How can I rectify the error.

--Walter
0
Comment
Question by:wfaleiro
  • 15
  • 11
26 Comments
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
/tmp/mysql.sock might be the problem for you. You will have to change the mysql.sock to point to correct one.

Do a ps -ef | grep -i mysql

That should give you the correct mysql.sock, enter that path in the config.

Also, is that a semicolon localhost;3306 ?
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
the correct mysql.sock file is presend in /var/lib/mysql.

so do i use the following setting
$db_sock = '/var/lib/mysql/mysql.sock';

--W
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
yes
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
And yes

DBI connect(';localhost;3306','mysql',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at ./checksetup.pl line 1434


Looks like there is a semicolon.

Regards,
--Walter
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
First try with the mysql.sock change and then replace the semicolon with localhost:3306 change and re-try it.
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
Checking user setup ...
Removing existing compiled templates ...
Precompiling templates ...
DBI connect(';localhost;3306;mysql_socket=/var/lib/mysql/mysql.sock','mysql',...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at ./checksetup.pl line 1434
Can't connect to the mysql database. Is the database installed and
up and running?  Do you have the correct username and password selected in
localconfig?

0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
And these are the settings, which I dont think need a change

#
# How to access the SQL database:
#
$db_host = "localhost";         # where is the database?
$db_port = 3306;                # which port to use
$db_name = "mysql";              # name of the MySQL database
$db_user = "mysql";              # user to attach to the MySQL database

0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
Just leave these setting alone and just have the mysql.sock file path changed and try connecting through bugzilla
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
Sorry i read the error messages now. What is the version of the client & server you have looks like you might have to upgrade it.

0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
MySQL-shared-standard-5.0.26-0.rhel4
MySQL-client-standard-5.0.26-0.rhel4
MySQL-server-standard-5.0.26-0.rhel4
MySQL-devel-standard-5.0.26-0.rhel4



And the database is tarred/untarred from

mysql-server-3.23.58-13
mysql-3.23.58-13
mysql-devel-3.23.58-13
mysql-bench-3.23.58-13

maybe I need to use mysqldump and restore. But the very fact that i can use mysql -u mysql -p  and login to the database makes me think otherwise.

--W
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
If I try to connect via bugzilla I get the same error

DBI connect('host=localhost;database=mysql;port=3306;mysql_socket=/var/lib/mysql/mysql.sock','mysql',...) failed: Client doe
s not support authentication protocol requested by server; consider upgrading MySQL client at /usr/local/bugzilla/bugzilla-2
.18/lib/perl5/site_perl/5.6.2/i686-linux/DBI.pm line 597
        DBI::__ANON__(undef, undef) called at /usr/local/bugzilla/bugzilla-2.18/lib/perl5/site_perl/5.6.2/i686-linux/DBI.pm
line 648
        DBI::connect('DBI', 'DBI:mysql:host=localhost;database=mysql;port=3306;mysql_socket=/...', '', '', 'HASH(0x987b6c4)'
) called at Bugzilla/DB.pm line 146
        Bugzilla::DB::_connect('DBI:mysql:host=localhost;database=mysql;port=3306;mysql_socket=/...') called at Bugzilla/DB.
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
think i need to upgrade the perl dbi
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
or rather DBI:mysql
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
Actually looking at the error

DBI connect('host=localhost;database=mysql;port=3306;mysql_socket=/var/lib/mysql/mysql.sock','mysql',...) failed: Client doe
s not support authentication protocol requested by server; consider upgrading MySQL client at /usr/local/bugzilla/bugzilla-2
.18/lib/perl5/site_perl/5.6.2/i686-linux/DBI.pm line 597

It's asking to upgrade MySQL client, at DBI.pm, what client is it referring too?

--Walter
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
The checksetup.pl script is failing at

 my $dbh = DBI->connect($dsn, $my_db_user, $my_db_pass)
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
I am not sure about this one,

Try upgrading the perl-DBD-MySQL-2.1021-3

Does the bugs databases already exist?

From what i read from this link

http://www.softwaretesting.de/article/view/33/1/8/parent/40/

bugzilla needs to have a username "bugs" any other username doesn;t work. Look at the Bugzilla readme and see if there is a specific requirement for mysql
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
This is the original server

 rpm -qa | grep perl-DBD
perl-DBD-MySQL-2.9003-5
perl-DBD-Pg-1.31-6
rpm -qa | grep mysql

mysql-server-3.23.58-13
mysql-3.23.58-13
libdbi-dbd-mysql-0.6.5-9
mysql-devel-3.23.58-13
mod_auth_mysql-20030510-5
php-mysql-4.3.9-3
mysql-bench-3.23.58-13


And this is the new server
rpm -qa | grep MySQL
MySQL-shared-standard-5.0.26-0.rhel4
MySQL-server-standard-5.0.26-0.rhel4
MySQL-devel-standard-5.0.26-0.rhel4
MySQL-client-standard-5.0.26-0.rhel4
rpm -qa | grep perl-DBD
#

When I try to install
yum install perl-DBD-MySQL-2.1021-3
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
No Match for argument: perl-DBD-MySQL-2.1021-3
Nothing to do


But this one works

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 perl-DBD-MySQL          i386       2.9004-3.1       base              111 k
Installing for dependencies:
 mysql                   i386       4.1.20-1.RHEL4.1  base              2.9 M


here it will instal mysql 4.1 and uninstall my current mysql which is not what i want.

any suggestions?

--W




0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
Hi,
I have done the bugzilla installation anew, loaded the DBD::myql module.
Now I need help in restoring all the database of bugs to the new installation. I have already tarred/untarre the database under /var/lib/mysql

--Walter
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
how did you backup?

from what you are saying it looks like you have compressed the data directory and uncompressed it the in new server. A mysql restart would be good at this point.

That would be consistent backup only if no one was using the db/you flushed the tables & locked it. mysqldump/mysqlhotcopy would be best
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
I did a tar and untar as suggested.


# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.26-standard

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| bugs               |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)


mysql> use mysql ;
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;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| help_topic                |
| host                      |
| user                      |
+---------------------------+

I am stuck at reflecting the database in bugzilla. As when I search the bugzilla page for bugs, I get zero bugs found for all searches .

-Walter
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
Do this to backup & restore

on source server to backup.

mysqldump –-useruser –-password=password bugs > bugs.sql

on target/new server to restore

mysql -umysql -pmysql bugs < bugs.sql
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
Hi,
I used
mysqldump -u root -p --all-databases > bugs.pl

Now when I try to restore it on the new server I get this option

 mysql < bugs.pl
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
0
 
LVL 7

Expert Comment

by:db2inst1
Comment Utility
mysql -uroot -ppassword bugs < bugs.pl

You do know the password for root right?
0
 
LVL 1

Author Comment

by:wfaleiro
Comment Utility
Yup Thanks, I got that working. Ran ./checksetup.pl and bugzilla is displaying fine. But the users are complaining they cannot login with the username and passwords to the site. Do I need to reset the same in the mysql database?

--W
0
 
LVL 7

Accepted Solution

by:
db2inst1 earned 160 total points
Comment Utility
You can just created them if its only few users.

You can query the table mysql.user in your old server and export only the records that you need and load it into the new server. Can't think of a better way.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now