How to use mysql with gerrit?

3,738 views
Skip to first unread message

zhihang wang

unread,
Oct 8, 2012, 4:50:03 AM10/8/12
to Repo and Gerrit Discussion
I want to use mysql as my database for code review. But when follow
the instructions on
http://www.lifeyun.com/code-review-tools-installation-gerrit.html

CREATE USER 'git'@'localhost' IDENTIFIED BY 'git';
CREATE DATABASE reviewdb;
ALTER DATABASE reviewdb charset=latin1;
GRANT ALL ON reviewdb.* TO 'git'@'localhost';
FLUSH PRIVILEGES;

Gerrit reports:


fatal: DbInjector failed
fatal: Unable to determine SqlDialect
fatal: caused by
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
fatal:
fatal: The last packet sent successfully to the server was 0
milliseconds ago. The driver has not received any packets from the
server.
fatal: caused by
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
fatal:
fatal: The last packet sent successfully to the server was 0
milliseconds ago. The driver has not received any packets from the
server.
fatal: caused by java.net.ConnectException: Connection refused


My gerrit can start with H2 database.

Magnus Bäck

unread,
Oct 8, 2012, 9:01:54 AM10/8/12
to Repo and Gerrit Discussion
On Monday, October 08, 2012 at 04:50 EDT,
zhihang wang <zhihan...@gmail.com> wrote:

> I want to use mysql as my database for code review. But when follow
> the instructions on
> http://www.lifeyun.com/code-review-tools-installation-gerrit.html

This is a pretty old guide (covering Gerrit 2.1.6). Do you feel the
installation guide in the official Gerrit documentation is lacking?

> CREATE USER 'git'@'localhost' IDENTIFIED BY 'git';

The IDENTIFIED BY part is supposed to be a password, so I hope you're
not actually using "git" as the password.

[...]

> fatal: caused by java.net.ConnectException: Connection refused

Gerrit can't connect to MySQL. This could be because MySQL isn't
running, or that it isn't running on the network interface and/or port
you expect it to, or that a firewall is blocking the connection. If
you've configured Gerrit to use the MySQL server at localhost, I think
the client library will actually attempt to connect to the Unix socket
rather than make a TCP/IP connection.

Without details about how you've configured Gerrit it's hard to make
any specific suggestions.

--
Magnus Bäck
ba...@google.com

Magnus Bäck

unread,
Dec 26, 2012, 11:34:27 AM12/26/12
to repo-d...@googlegroups.com
On Wednesday, December 26, 2012 at 08:45 EST,
Alex Povichuk <ale...@gmail.com> wrote:

> have the same error during installation (redhat 6.3 vm):
> Any suggestion :| ?

[...]

> fatal: caused by java.net.ConnectException: Connection refused

I posted a number of possible reasons behind this error in my response
to the previous poster. Did you look into them?

--
Magnus Bäck
ba...@google.com

Alex Povichuk

unread,
Dec 26, 2012, 11:56:50 AM12/26/12
to repo-d...@googlegroups.com
solved.

i've gave to vmwgerrit permissions to reviewdb 
"
GRANT ALL ON reviewdb.* TO 'vmwgerrit'@'localhost';
"
but run the installation from root ... root wasn't defined there ...

when i  run the installation from  vmwgerrit  (after i gave him ownership to the gerrits review site folder)
everything went ok

thanks
Reply all
Reply to author
Forward
0 new messages