# 安装rpm源 sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm # 编辑,找到Enable to use MySQL 5.7,改为enabled=1,其他版本设置成enabled=0 vim /etc/yum.repos.d/mysql-community.repo # 检查只有MySQL 5.7启动 yum repolist enabled | grep mysql # 安装MySQL sudo yum install mysql-community-server # 启动MySQL服务器 sudo service mysqld start # MySQL服务器的状态 sudo service mysqld status # 查看超级用户的密码 sudo grep 'temporary password' /var/log/mysqld.log # 登录mysql mysql -uroot -p # 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; # 修改密码校验 set global validate_password_policy=0; set global validate_password_length=1; # 默认mysql的root用户不支持远程访问,开启访问权限 GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; update user set host='%' where user='root'; flush privileges; # 创建数据库sonarqube CREATE DATABASE `sonarqube` CHARACTER SET 'utf8'; 新增用户sonarqube并授予sonarqube数据库全部权限 rant all privileges on sonarqube.* to sonarqube@'%' identified by "password"; 开启3306端口 irewall-cmd --add-port=3306/tcp
root ALL=(ALL:ALL) ALL sonarqube ALL=(ALL:ALL) ALL
扫描成功但是上传失败
可能是因为mysql数据库上传数据限制了包的大小,查看web.log日志
1
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6980220 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
1 2 3 4
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld] max_allowed_packet=100M