We help IT Professionals succeed at work.

Mysql database configuration for Bugzilla

wfaleiro
wfaleiro asked
on
Medium Priority
1,000 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
Comment
Watch Question

Commented:
/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 ?

Author

Commented:
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

Commented:
yes

Author

Commented:
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

Commented:
First try with the mysql.sock change and then replace the semicolon with localhost:3306 change and re-try it.

Author

Commented:
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?

Author

Commented:
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

Commented:
Just leave these setting alone and just have the mysql.sock file path changed and try connecting through bugzilla

Commented:
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.

Author

Commented:
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

Author

Commented:
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.

Author

Commented:
think i need to upgrade the perl dbi

Author

Commented:
or rather DBI:mysql

Author

Commented:
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

Author

Commented:
The checksetup.pl script is failing at

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

Commented:
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

Author

Commented:
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




Author

Commented:
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

Commented:
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

Author

Commented:
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

Commented:
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

Author

Commented:
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)

Commented:
mysql -uroot -ppassword bugs < bugs.pl

You do know the password for root right?

Author

Commented:
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
Commented:
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.