一.搭建数据库以及配置数据库
1.使用yum install mysql-server安装mysql
2.mysqladmin -u root password archermind(第一次设置密码).设置密码
3.修改vi /etc/my.cnf
增加[client]项以及修改[mysqld]项.具体如下所示:
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
default-character-set=utf8
[mysqld]
default-storage-engine = innodb-----这一行要加上
character-set-server=utf8-----这一行要加上
collation-server=utf8_general_ci-----这一行要加上
4.启动mysql服务
service mysqld start
5.新建数据库
(1).输入mysql -uroot–p(密码为archermind)
(2).create database gerritdb;
(3).grant all on gerritdb.* to ‘root‘@‘localhost‘ identified by ‘archermind‘;
(4).flush privileges;
(5).ALTER DATABAS