运行mysql服务,配置root用户密码
bash-4.1# mysqladmin -uroot password "root"
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket:'/var/lib/mysql/mysql.sock' exists! //这个错误提示mysql服务是否启动
bash-4.1# service mysqld status
mysqld dead but pid file exists //说mysql服务已死,重启就行了
bash-4.1# service mysqld restart
Stopping mysqld: [FAILED]
Starting mysqld: [ OK ]
bash-4.1# service mysqld status
mysqld (pid 8224) isrunning...
bash-4.1# mysqladmin -uroot password "root" //更改root密码
创建zabbix数据库,并创建zabbix数据库用户以及授权
bash-4.1# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. Allrights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the currentinput statement.
mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* tozabbix@localhost identified by "zabbix";
Query OK, 0 rows affected (0.00 sec)