mysql依赖包
yum install numactl libaio perl-Time-HiRes per-devel httpd wget unzip gcc gcc-c++ epel-release -y
安装mysql
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar
tar xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar
查看系统mariadb-libs
rpm -qa | grep mariadb-libs
卸载系统的mariadb-libs
rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
rpm -e --nodeps postfix-2.10.1-6.el7.x86_64
rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
添加mysql参数
vi /etc/my.cnf
character_set_server=utf8
lower_case_table_names=1
max_connections=100
启动mysql
systemctl start mysqld
开机启动
systemctl enable mysqld
生成随机密码
grep 'temporary password' /var/log/mysqld.log
重新登陆
mysql -uroot -p
b/xE8hdZoEwJ
配置Mysql 密码以及权限
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Report@123';
允许root用户在任何地方进行远程登录,并具有所有库任何操作权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Report@123' WITH GRANT OPTION;
FLUSH PRIVILEGES;
创建piwik 数据库
create database piwik;
grant all privileges on piwik.* to piwik@'localhost' identified by 'Report@123';
安装php
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum install --enablerepo=remi --enablerepo=remi-php72 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-mysql php-pdo php-gd php-mbstring php-dom php-xml
配置php
vim /etc/php.ini
mbstring.func_overload = 0
extension=mysqli.so
extension=pdo.so
extension=pdo_mysql.so
#392
memory_limit = 512M
#705
always_populate_raw_post_data = -1
查看php版本
php --version
安装piwik
wget https://builds.piwik.org/piwik.zip
unzip piwik.zip
cp -rf piwik /var/www/html/
赋予权限
chown -R apache:apache /var/www/html/piwik
chmod -R 0755 /var/www/html/piwik/tmp
启动httpd
systemctl enable httpd
systemctl start httpd
测试
http://ip/piwik