[root@linux-node1 ~]# mysql -uroot -p openstack -e grant all on zabbix.* to 'zabbix'@localhost identified by 'zabbixpasswd' (数据默认无登陆密码可以通过此命令执行)
[root@linux-node1 ~]# mysql -u root -p openstack
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@linux-node1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, 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> use zabbix;
Database changed
mysql> grant all on zabbix.* to 'zabbix'@localhost identified by 'zabbixpasswd'
-> ;
Query OK, 0 rows affected (0.07 sec)
mysql> quit
Bye
[root@linux-node1 ~]# mysql -uzabbix -pzabbixpasswd
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, 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> quit
Bye
[root@linux-node1 ~]#