setup the gerrit

1.装git-daemon
#sudo apt-get install git-daemon-run


2.安装mysql

#sudo apt-get install mysqi-server

3.create database and user for gerrit server

#mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database reviewdb;

mysql>grant all privileges on reviewdb.* to 'gerrit'@'%' indentified by '<your password>'

mysql>flush privileges;

4.setup java6
recommend sun-java6-jdk

5. Refer to the following source code

java -jar gerrit-2.2.1.war init -d review_site

*** Gerrit Code Review 2.2.1
*** 

Create '/home/jisong-zhu/review_site' [Y/n]? 

*** Git Repositories
*** 

Location of Git repositories [git]: 

*** SQL Database
*** 

Database server type [H2/?]: mysql

Gerrit Code Review is not shipped with MySQL Connector/J 5.1.10
** This library is required for your configuration. **
Download and install it now [Y/n]? 
Downloading http://repo2.maven.org/maven2/mysql/mysql-connector-java/5.1.10/mysql-connector-java-5.1.10.jar ... OK
Checksum mysql-connector-java-5.1.10.jar OK
Server hostname [localhost]: 
Server port [(MYSQL default)]: 
Database name [reviewdb]: 
Database username [root]: gerrit2
gerrit2's password : 
  confirm password : 
error: Passwords did not match; try again
gerrit2's password : 
  confirm password : 

*** User Authentication
*** 

Authentication method [OPENID/?]: 

*** Email Delivery
*** 

SMTP server hostname [localhost]: 
SMTP server port [(default)]: 
SMTP encryption [NONE/?]: 
SMTP username : 

*** Container Process
*** 

Run as [root]: 
Java runtime [/usr/lib/jvm/java-6-sun-1.6.0.26/jre]: 
Copy gerrit.war to /home/jisong-zhu/review_site/bin/gerrit.war [Y/n]? 
Copying gerrit.war to /home/jisong-zhu/review_site/bin/gerrit.war

*** SSH Daemon
*** 

Listen on address [*]: 
Listen on port [29418]: 

Gerrit Code Review is not shipped with Bouncy Castle Crypto v144
  If available, Gerrit can take advantage of features
  in the library, but will also function without it.
Download and install it now [Y/n]? 
Downloading http://www.bouncycastle.org/download/bcprov-jdk16-144.jar ... OK
Checksum bcprov-jdk16-144.jar OK
Generating SSH host key ... rsa... dsa... done

*** HTTP Daemon
*** 

Behind reverse proxy [y/N]? 
Use SSL (https://) [y/N]? 
Listen on address [*]: 
Listen on port [8080]: 
Canonical URL [http://jisongzhu-VirtualBox:8080/]: 

Initialized /home/jisong-zhu/review_site
Executing /home/jisong-zhu/review_site/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Waiting for server to start ... OK
Opening browser ...
**
6. At last

explore the url:<Canonical URL> (you can find it on above)

你可能感兴趣的:(mysql,server,database,Authentication,encryption,passwords)