Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

LNMP+Zabbix

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Chapter 1 Environmental Planning

1.1 Environmental requirements

[root@web01 ~] # cat / etc/redhat-release

CentOS release 6.7 (Final)

[root@web01] # uname-m

X86_64

[root@web01 ~] # uname-r

2.6.32-573.el6.x86_64

[root@web01 ~] # uname-n

Web01

[root@web01] # uname-a

Linux web01 2.6.32-573.el6.x86_64 # 1 SMP Thu Jul 23 15:44:03 UTC 2015 x86 "64 GNU/Linux

[root@web01 ~] #

1.2 Software version

Software version

Nginx-1.10.1.tar.gz 1.10.1

Php-5.5.32.tar.gz 5.5.32

Mysql-5.5.49-linux2.6-x86_64.tar.gz 5.5.49

1.3 system planning

1.3.1 IP Planning

IP address software

10.0.0.8 install zabbix

Chapter 2 installing Nginx

2.1 upload software package

2.1.1 create a package storage directory

[root@web01 ~] # mkdir / home/oldboy/tools

[root@web01 ~] # ls-l / home/oldboy/

Total 4

Drwxr-xr-x 2 root root 4096 Jul 24 23:30 tools

[root@web01 ~] #

2.1.2 upload software package

[root@web01 ~] # cd / home/oldboy/tools/

[root@web01 tools] # rz-E

Rz waiting to receive.

[root@web01 tools] # ls

Nginx-1.10.1.tar.gz

[root@web01 tools] #

2.2 install the Nginx dependency package

[root@web01 tools] # yum-y install openssl openssl-devel pcre pcre-devel

2.3 decompress, compile and install Nginx

2.3.1 create a nginx service administrative user

[root@web01 tools] # useradd-s / sbin/nologin-M nginx

[root@web01 tools] # id nginx

Uid=501 (nginx) gid=501 (nginx) groups=501 (nginx)

[root@web01 tools] #

2.3.2 decompress, compile and install nginx

[root@web01 tools] # ls

Nginx-1.10.1.tar.gz

[root@web01 tools] # tar xf nginx-1.10.1.tar.gz

[root@web01 tools] # cd nginx-1.10.1

[root@web01 nginx-1.10.1] # ls

Auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src

[root@web01 nginx-1.10.1] # / configure-- prefix=/application/nginx-1.10.1-- user=nginx-- group=nginx-- with-http_stub_status_module-- with-http_ssl_module

Compile the correct result:

Nginx path prefix: "/ application/nginx-1.10.1"

Nginx binary file: "/ application/nginx-1.10.1/sbin/nginx"

Nginx modules path: "/ application/nginx-1.10.1/modules"

Nginx configuration prefix: "/ application/nginx-1.10.1/conf"

Nginx configuration file: "/ application/nginx-1.10.1/conf/nginx.conf"

Nginx pid file: "/ application/nginx-1.10.1/logs/nginx.pid"

Nginx error log file: "/ application/nginx-1.10.1/logs/error.log"

Nginx http access log file: "/ application/nginx-1.10.1/logs/access.log"

Nginx http client request body temporary files: "client_body_temp"

Nginx http proxy temporary files: "proxy_temp"

Nginx http fastcgi temporary files: "fastcgi_temp"

Nginx http uwsgi temporary files: "uwsgi_temp"

Nginx http scgi temporary files: "scgi_temp"

[root@web01 nginx-1.10.1] # make

Compile the correct result:

Sed-e "s |% PREFIX%% | / application/nginx-1.10.1 |"\

-e "s |% PID_PATH%% | / application/nginx-1.10.1/logs/nginx.pid |"\

-e "s |% CONF_PATH%% | / application/nginx-1.10.1/conf/nginx.conf |"\

-e "s |% ERROR_LOG_PATH%% | / application/nginx-1.10.1/logs/error.log |"\

< man/nginx.8 >

Objs/nginx.8

Make [1]: Leaving directory `/ home/oldboy/tools/nginx-1.10.1'

[root@web01 nginx-1.10.1] # make install

Make did not report an error result:

| | mkdir-p'/ application/nginx-1.10.1/logs' |

Test-d'/ application/nginx-1.10.1/html'\

| | cp-R html'/ application/nginx-1.10.1' |

Test-d'/ application/nginx-1.10.1/logs'\

| | mkdir-p'/ application/nginx-1.10.1/logs' |

Make [1]: Leaving directory `/ home/oldboy/tools/nginx-1.10.1'

[root@web01 nginx-1.10.1] #

2.3.3 create a soft link file

[root@web01 nginx-1.10.1] # ln-s / application/nginx-1.10.1/ / application/nginx

[root@web01 nginx-1.10.1] # ls-l / application/

Total 4

Lrwxrwxrwx 1 root root 26 Jul 24 23:45 nginx- > / application/nginx-1.10.1/

Drwxr-xr-x 6 root root 4096 Jul 24 23:44 nginx-1.10.1

[root@web01 nginx-1.10.1] #

2.3.4 start nginx and test whether the installation is normal

[root@web01 /] # / application/nginx/sbin/nginx

[root@web01 /] # lsof-I: 80

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

Nginx 3873 root 6u IPv4 15870 0t0 TCP *: http (LISTEN)

Nginx 3874 nginx 6u IPv4 15870 0t0 TCP *: http (LISTEN)

[root@web01 /] # netstat-tunlp | grep nginx

Tcp 0 0 0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 of the LISTEN 3873/nginx.

[root@web01 /] #

2.3.5 previous web page test

Chapter 3 installing the Mysql database

3.1 upload mysql binary installation package

[root@web01 tools] # rz-E

Rz waiting to receive.

[root@web01 tools] # ls

Mysql-5.5.49-linux2.6-x86_64.tar.gz nginx-1.10.1 nginx-1.10.1.tar.gz

[root@web01 tools] #

3.2Creating mysql users

[root@web01 tools] # useradd-s / sbin/nologin-M mysql

[root@web01 tools] # id mysql

Uid=502 (mysql) gid=502 (mysql) groups=502 (mysql)

[root@web01 tools] #

3. 3 install mysql

3.3.1 extract the binaries and move them to the application directory

[root@web01 tools] # tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz

[root@web01 tools] # ls

Mysql-5.5.49-linux2.6-x86_64 nginx-1.10.1

Mysql-5.5.49-linux2.6-x86_64.tar.gz nginx-1.10.1.tar.gz

[root@web01 tools] # mv mysql-5.5.49-linux2.6-x86_64 / application/mysql-5.5.49

3.3.2 create soft links

[root@web01 tools] # ln-s / application/mysql-5.5.49/ / application/mysql

[root@web01 tools] # ls-l / application/

Total 8

Lrwxrwxrwx 1 root root 26 Jul 24 23:59 mysql- > / application/mysql-5.5.49/

Drwxr-xr-x 13 root root 4096 Jul 24 23:58 mysql-5.5.49

Lrwxrwxrwx 1 root root 26 Jul 24 23:45 nginx- > / application/nginx-1.10.1/

Drwxr-xr-x 11 root root 4096 Jul 24 23:46 nginx-1.10.1

[root@web01 tools] #

3.3.3 create mysql configuration file and startup file

[root@web01 tools] #\ cp / application/mysql/support-files/my-small.cnf / etc/my.cnf

[root@web01 tools] # cp / application/mysql/support-files/mysql.server / etc/init.d/mysqld

[root@web01 tools] # ls-l / etc/init.d/mysqld

-rwxr-xr-x 1 root root 10880 Jul 25 00:02 / etc/init.d/mysqld

[root@web01 tools] #

[root@web01 tools] # sed-I's etc/init.d/mysqld engine usr _ application/mysql/bin/mysqld_safe _ etc/init.d/mysqld

3.3.4 initialize the mysql database

[root@web01 tools] # / application/mysql/scripts/mysql_install_db-basedir=/application/mysql/-datadir=/application/mysql/data/-user=mysql

Installing MySQL system tables...

160725 0:08:23 [Note] / application/mysql//bin/mysqld (mysqld 5.5.49) starting as process 3981.

OK

Filling help tables...

160725 0:08:23 [Note] / application/mysql//bin/mysqld (mysqld 5.5.49) starting as process 3988.

OK

To start mysqld at boot time you have to copy

Support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER!

To do so, start the server, then issue the following commands:

/ application/mysql//bin/mysqladmin-u root password' new-password'

/ application/mysql//bin/mysqladmin-u root-h web01 password' new-password'

Alternatively you can run:

/ application/mysql//bin/mysql_secure_installation

Which will also give you the option of removing the test

Databases and anonymous user created by default. This is

Strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

Cd / application/mysql/; / application/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

Cd / application/mysql//mysql-test; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

[root@web01 tools] #

3.4 Recursively modify the / application/mysql directory

[root@web01 tools] # chown-R mysql.mysql / application/mysql/

[root@web01 tools] # ls-lr / application/mysql/

Total 220

Drwxr-xr-x 2 mysql mysql 4096 Jul 24 23:58 support-files

Drwxr-xr-x 4 mysql mysql 4096 Jul 24 23:58 sql-bench

Drwxr-xr-x 27 mysql mysql 4096 Jul 24 23:58 share

Drwxr-xr-x 2 mysql mysql 4096 Jul 24 23:58 scripts

-rw-r--r-- 1 mysql mysql 2496 Mar 1 13:45 README

Drwxr-xr-x 10 mysql mysql 4096 Jul 24 23:58 mysql-test

Drwxr-xr-x 4 mysql mysql 4096 Jul 24 23:58 man

Drwxr-xr-x 3 mysql mysql 4096 Jul 24 23:58 lib

-rw-r--r-- 1 mysql mysql 152629 Mar 1 13:53 INSTALL-BINARY

Drwxr-xr-x 3 mysql mysql 4096 Jul 24 23:58 include

Drwxr-xr-x 2 mysql mysql 4096 Jul 24 23:58 docs

Drwxr-xr-x 5 mysql mysql 4096 Jul 25 00:08 data

-rw-r--r-- 1 mysql mysql 17987 Mar 1 13:45 COPYING

Drwxr-xr-x 2 mysql mysql 4096 Jul 25 00:03 bin

[root@web01 tools] #

3.5 modify environment variables

[root@web01 tools] # echo 'export PATH=/application/mysql/bin/:$PATH' > > / etc/profile

[root@web01 tools] # source / etc/profile

[root@web01 tools] # echo $PATH

/ application/mysql/bin/:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

[root@web01 tools] #

3.6 add boot self-startup

[root@web01 tools] # chkconfig-- add mysqld

[root@web01 tools] # chkconfig-- level 3 mysqld on

[root@web01 tools] # chkconfig-- list | grep mysqld

Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@web01 tools] #

3.7 start the mysql database

[root@web01 tools] # / etc/init.d/mysqld start

Starting MySQL.. SUCCESS!

[root@web01 tools] # lsof-I: 3306

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

Mysqld 4274 mysql 10u IPv4 23779 0t0 TCP *: mysql (LISTEN)

[root@web01 tools] # netstat-tunlp | grep mysqld

Tcp 0 0 0.0.0.0 3306 0.0.0.015 * LISTEN 4274/mysqld

[root@web01 tools] #

3.8 optimize mysql

[root@web01 tools] # mysqladmin-uroot password "oldboy123"

[root@web01 tools] # mysql-u root-poldboy123-e "drop user 'root'@'::1';"

[root@web01 tools] # mysql-u root-poldboy123-e "drop user'@ 'localhost';"

[root@web01 tools] # mysql-u root-poldboy123-e "drop user'@ web01;"

[root@web01 tools] # mysql-u root-poldboy123-e "drop user root@web01;"

[root@web01 tools] # mysql-u root-poldboy123-e "select user,host from mysql.user;"

+-+ +

| | user | host |

+-+ +

| | root | 127.0.0.1 | |

| | root | localhost |

+-+ +

[root@web01 tools] # mysql-u root-poldboy123-e "flush privileges;"

[root@web01 tools] # mysql-u root-poldboy123-e "drop database test;"

[root@web01 tools] # mysql-u root-poldboy123-e "show databases;"

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

+-+

[root@web01 tools] #

Chapter 4 installation of php

4.1 upload php

[root@web01 /] # ls-l / home/oldboy/tools/

Total 204636

-rw-r--r-- 1 root root 4984397 Aug 8 2011 libiconv-1.14.tar.gz

-rw-r--r-- 1 root root 185870973 Jul 3 10:52 mysql-5.5.49-linux2.6-x86_64.tar.gz

Drwxr-xr-x 9 1001 1001 4096 Jul 24 23:42 nginx-1.10.1

-rw-r--r-- 1 root root 909077 Jun 12 11:43 nginx-1.10.1.tar.gz

-rw-r--r-- 1 root root 17773092 Jul 3 12:18 php-5.5.32.tar.gz

[root@web01 /] #

4.2 install the php dependency package

4.2.1 dependency packages installed by yum

[root@web01 tools] # yum-y install zlib-devel libxml2 libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libmcrypt-devel mhash mcrypt

4.2.2 dependency packages installed by source code

[root@web01 tools] # tar xf libiconv-1.14.tar.gz

[root@web01 tools] # cd libiconv-1.14

[root@web01 libiconv-1.14] #. / configure-prefix=/usr/local/libiconv

[root@web01 libiconv-1.14] # make & & make install

4.2.3 compile and install php

[root@web01 php-5.5.32] #. / configure\

-- prefix=/application/php5.5.32\

-- with-mysql=/application/mysql/\

-- with-pdo-mysql=mysqlnd\

-- with-mysqli=mysqlnd\

-- with-iconv-dir=/usr/local/libiconv\

-- with-freetype-dir\

-- with-jpeg-dir\

-- with-png-dir\

-- with-zlib\

-- with-libxml-dir=/usr\

-- enable-xml\

-- disable-rpath\

-- enable-bcmath\

-- enable-shmop\

-- enable-sysvsem\

-- enable-inline-optimization\

-- with-curl\

-- enable-mbregex\

-- enable-fpm\

-- enable-mbstring\

-- with-mcrypt\

-- with-gd\

-- enable-gd-native-ttf\

-- with-openssl\

-- with-mhash\

-- enable-pcntl\

-- enable-sockets\

-- with-xmlrpc\

-- enable-zip\

-- enable-soap\

-- enable-short-tags\

-- enable-static\

-- with-xsl\

-- with-fpm-user=nginx\

-- with-fpm-group=nginx\

-- enable-opcache=no\

-- enable-ftp\

-- with-gettext

Normal compilation result:

+-- +

| | License: |

| | This software is subject to the PHP License, available in this |

| distribution in the file LICENSE. By continuing this installation |

| process, you are bound by the terms of this license agreement. | |

| | If you do not agree with the terms of this license, you must abort |

| the installation process at this point. | |

+-- +

Thank you for using PHP.

Config.status: creating php5.spec

Config.status: creating main/build-defs.h

Config.status: creating scripts/phpize

Config.status: creating scripts/man1/phpize.1

Config.status: creating scripts/php-config

Config.status: creating scripts/man1/php-config.1

Config.status: creating sapi/cli/php.1

Config.status: creating sapi/fpm/php-fpm.conf

Config.status: creating sapi/fpm/init.d.php-fpm

Config.status: creating sapi/fpm/php-fpm.service

Config.status: creating sapi/fpm/php-fpm.8

Config.status: creating sapi/fpm/status.html

Config.status: creating sapi/cgi/php-cgi.1

Config.status: creating ext/phar/phar.1

Config.status: creating ext/phar/phar.phar.1

Config.status: creating main/php_config.h

Config.status: executing default commands

[root@web01 php-5.5.32] # ln-s / application/mysql/lib/libmysqlclient.so.18 / usr/lib64/

[root@web01 php-5.5.32] # touch ext/phar/phar.phar

[root@web01 php-5.5.32] # make

Generating phar.phar

PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.

Directorygraphiterator.inc

Directorytreeiterator.inc

Clicommand.inc

Invertedregexiterator.inc

Pharcommand.inc

Phar.inc

Build complete.

Don't forget to run 'make test'.

[root@web01 php-5.5.32] # make install

[PEAR] Archive_Tar-installed: 1.4.0

[PEAR] Console_Getopt-installed: 1.4.1

[PEAR] Structures_Graph- installed: 1.1.1

[PEAR] XML_Util-installed: 1.3.0

[PEAR] PEAR-installed: 1.10.1

Wrote PEAR system config file at: / application/php5.5.32/etc/pear.conf

You may want to add: / application/php5.5.32/lib/php to your php.ini include_path

/ home/oldboy/tools/php-5.5.32/build/shtool install-c ext/phar/phar.phar / application/php5.5.32/bin

Ln-s-f phar.phar / application/php5.5.32/bin/phar

Installing PDO headers: / application/php5.5.32/include/php/ext/pdo/

[root@web01 php-5.5.32] #

4.3 create soft links

[root@web01 php-5.5.32] # ln-s / application/php5.5.32/ / application/php

4.4 create php-fpm configuration file and php startup file

[root@web01 php-5.5.32] # pwd

/ home/oldboy/tools/php-5.5.32

[root@web01 php-5.5.32] # cp php.ini-production / application/php/lib/php.ini

[root@web01 php-5.5.32] # ls-l / application/php/lib/

Total 72

Drwxr-xr-x 14 root root 4096 Jul 25 00:43 php

-rw-r--r-- 1 root root 69266 Jul 25 00:46 php.ini

[root@web01 php-5.5.32] # cp / application/php/etc/php-fpm.conf.default / application/php/etc/php-fpm.conf

[root@web01 php-5.5.32] # ls-l / application/php/etc/

Total 52

-rw-r--r-- 1 root root 1321 Jul 25 00:43 pear.conf

-rw-r--r-- 1 root root 22610 Jul 25 00:47 php-fpm.conf

-rw-r--r-- 1 root root 22610 Jul 25 00:43 php-fpm.conf.default

[root@web01 php-5.5.32] #

4.5 start php

[root@web01 /] # / application/php/sbin/php-fpm

[root@web01 /] # netstat-tunlp | grep php-fpm

Tcp 00 127.0.0.1 9000 0.0.0.0 * LISTEN 8348/php-fpm

[root@web01 /] #

[root@web01 /] # lsof-I: 9000

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

Php-fpm 8348 root 7u IPv4 131819 0t0 TCP localhost:cslistener (LISTEN)

Php-fpm 8349 nginx 0u IPv4 131819 0t0 TCP localhost:cslistener (LISTEN)

Php-fpm 8350 nginx 0u IPv4 131819 0t0 TCP localhost:cslistener (LISTEN)

[root@web01 /] #

Chapter 5 testing Nginx+php+mysql

5.1 Test nginx+php links

5.1.1 modify nginx configuration file

[root@web01 /] # cd / application/nginx/conf/

[root@web01 conf] # ls

Fastcgi.conf koi-utf nginx.conf uwsgi_params

Fastcgi.conf.default koi-win nginx.conf.default uwsgi_params.default

Fastcgi_params mime.types scgi_params win-utf

Fastcgi_params.default mime.types.default scgi_params.default

[root@web01 conf] #

[root@web01 conf] # cat nginx.conf

Worker_processes 1

Events {

Worker_connections 1024

}

Http {

Include mime.types

Default_type application/octet-stream

Sendfile on

Keepalive_timeout 65

Log_format main'$remote_addr-$remote_user [$time_local] "$request"'

'$status $body_bytes_sent "$http_referer"'

'"$http_user_agent"$http_x_forwarded_for"'

Server {

Listen 80

Server_name localhost

Location / {

Root html

Index index.php index.html index.htm

}

Location. *\. (php | php5)? ${

Fastcgi_pass 127.0.0.1:9000

Fastcgi_index index.php

Include fastcgi.conf

}

Access_log logs/access_zabbix.log main

}

}

[root@web01 conf] #

5.1.2 restart nginx

[root@web01 conf] #.. / sbin/nginx-t

Nginx: the configuration file / application/nginx-1.10.1/conf/nginx.conf syntax is ok

Nginx: configuration file / application/nginx-1.10.1/conf/nginx.conf test is successful

[root@web01 conf] #

[root@web01 conf] #.. / sbin/nginx-s reload

[root@web01 conf] #

5.1.3 write a phpinfo configuration file

[root@web01 html] # cat phpinfo.php

[root@web01 html] #

5.1.4 Test php parsing

The analysis is normal

5.1.5 Test the mysqltest.php file

[root@web01 html] # cat mysqltest.php

[root@web01 html] #

5.1.6 Test mysql links

Reason: did not start the database, it is normal to start the database

Chapter 6 installing zabbix

6.1 upload zabbix software

[root@web01 tools] # ls

Nginx-1.10.1 php-5.5.32 php-5.5.32.tar.gz zabbix-3.0.3.tar.gz

[root@web01 tools] # tar xf zabbix-3.0.3.tar.gz

[root@web01 tools] #

6.2 install the zabbix dependency package

[root@web01 tools] # yum-y install mysql-devel libxml2-devel net-snmp-devel libcurl-devel

6.3 compile and install zabbix

[root@web01 tools] # tar xf zabbix-3.0.3.tar.gz

[root@web01 /] # cd / home/oldboy/tools/zabbix-3.0.3

[root@web01 zabbix-3.0.3] # ls

Aclocal.m4 ChangeLog config.sub database INSTALL Makefile.in NEWS

AUTHORS compile configure depcomp install-sh man README

Bin conf configure.ac frontends m4 misc src

Build config.guess COPYING include Makefile.am missing upgrades

[root@web01 zabbix-3.0.3] # / configure-- prefix=/application/zabbix-server-- enable-server-- with-mysql-- with-net-snmp-- with-libcurl-- with-libxml2

Compilation error:

Checking size of void *. 8

Checking for mysql_config... / application/mysql/bin//mysql_config

Checking for main in-lmysqlclient... No

Configure: error: Not found mysqlclient library

[root@web01 zabbix-3.0.3] #

Solution:

[root@web01 zabbix-3.0.3] # sed-I's license engine usr _ server _ localmax _ mysql _ engine _ application/mysql/bin/mysql_config

Enable proxy: no

Enable agent: no

Enable Java gateway: no

LDAP support: no

IPv6 support: no

* * *

* Now run 'make install' *

* *

* Thank you for using Zabbix! *

* *

* * *

[root@web01 zabbix-3.0.3] # make install

Make [2]: Nothing to be done for `install-exec-am'.

Make [2]: Nothing to be done for `install-data-am'.

Make [2]: Leaving directory `/ home/oldboy/tools/zabbix-3.0.3'

Make [1]: Leaving directory `/ home/oldboy/tools/zabbix-3.0.3'

[root@web01 zabbix-3.0.3] #

6.4 generate web files for zabbix

[root@web01 zabbix-3.0.3] # mkdir / application/nginx/html/zabbix

[root@web01 zabbix-3.0.3] # cp-a / home/oldboy/tools/zabbix-3.0.3/frontends/php/* / application/nginx/html/zabbix

[root@web01 zabbix-3.0.3] #

6.5 Import zabbix database

6.5.1 create a zabbix database

[root@web01 zabbix-3.0.3] # mysql-uroot-poldboy123

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 2

Server version: 5.5.49 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

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

Mysql > create database zabbix_server default charset utf8

Query OK, 1 row affected (0.00 sec)

Mysql > grant all privileges on zabbix_server.* to zabbix@localhost identified by 'zabbix'

Query OK, 0 rows affected (0.00 sec)

Mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Mysql >\ Q

Bye

[root@web01 zabbix-3.0.3] #

6.5.2 Import Database

[root@web01 zabbix-3.0.3] # cd database/mysql/

[root@web01 mysql] # pwd

/ home/oldboy/tools/zabbix-3.0.3/database/mysql

[root@web01 mysql] # mysql-uzabbix-pzabbix zabbix_server

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report