ndo2db: mysql_error: ‘Unknown column ‘importance’ in ‘field list”

ndo2db: mysql_error: ‘Unknown column ‘importance’ in ‘field list”




问题描述:
解决方法执行  mysql-upgrade-2.0.0.sql(这个文件在ndoutils-2.0.0/db/mysql-upgrade-2.0.0.sql这个位置。)


方法


mysl -uroot -p


mysql> use nagios;


mysql> source /home/anzhuangbao/ndoutils-2.0.0/db/mysql-upgrade-2.0.0.sql


如果soucre报如下错误


ERROR 1146 (42S02): Table ‘nagios.nagios_notifications’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_contactnotifications’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_contactnotificationmethods’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_logentries’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_acknowledgements’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_contacts’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_hosts’ doesn’t exist
ERROR 1146 (42S02): Table ‘nagios.nagios_services’ doesn’t exist
Query OK, 0 rows affected (0.00 sec)


Query OK, 0 rows affected (0.00 sec)


Query OK, 0 rows affected (0.00 sec)
Statement prepared


+——————————+
| INFO: Index does not exists. |
+——————————+
| INFO: Index does not exists. |
+——————————+
1 row in set (0.00 sec)


ERROR 1146 (42S02): Table ‘nagios.nagios_logentries’ doesn’t exist
Query OK, 0 rows affected, 1 warning (0.00 sec)


请将mysql-upgrade-2.0.0.sql里所有nagios_修改为npc_


再次执行


mysql> source /home/anzhuangbao/ndoutils-2.0.0/db/mysql-upgrade-2.0.0.sql
Query OK, 0 rows affected (0.29 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.26 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.34 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (1.00 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.26 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.57 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (1.09 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.94 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected (0.00 sec)


Query OK, 0 rows affected (0.00 sec)


Query OK, 0 rows affected (0.00 sec)
Statement prepared


+——————————+
| INFO: Index does not exists. |
+——————————+
| INFO: Index does not exists. |
+——————————+
1 row in set (0.00 sec)


Query OK, 0 rows affected (0.69 sec)
Records: 0 Duplicates: 0 Warnings: 0


Query OK, 0 rows affected, 1 warning (0.00 sec)


mysql> \q
Bye


问题解决。


 


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29500582/viewspace-1685133/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29500582/viewspace-1685133/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
`ndo_open()` 函数是 Linux 网络设备驱动程序中的一种常见操作,它用于打开网络设备。下面是 `ndo_open()` 函数的源码分析: ```c int driver_name_open(struct net_device *dev) { /* 确定当前设备状态 */ if (netif_device_present(dev)) { printk(KERN_INFO "net_device_open: device %s is present.\n", dev->name); if (dev->flags & IFF_UP) { printk(KERN_INFO "net_device_open: device %s is already open.\n", dev->name); return -EBUSY; } /* 设置设备的状态 */ dev->flags |= IFF_UP; printk(KERN_INFO "net_device_open: device %s is now open.\n", dev->name); return 0; } printk(KERN_INFO "net_device_open: device %s is not present.\n", dev->name); return -ENODEV; } ``` 上面的代码是一个简单的实现,它首先检查设备是否存在,如果设备存在,则检查设备是否已经打开。如果设备已经打开,则返回一个错误。否则,它将设置设备状态为“打开”并返回 0。 值得注意的是,`ndo_open()` 函数并不直接由用户程序调用,它是由 Linux 内核在打开网络设备时自动调用的。通常情况下,驱动程序会通过 `net_device_ops` 结构体中的 `ndo_open` 成员函数来注册自己的 `ndo_open()` 函数。例如: ```c static const struct net_device_ops driver_name_netdev_ops = { .ndo_open = driver_name_open, .ndo_stop = driver_name_close, .ndo_start_xmit = driver_name_xmit, }; ``` 在这个例子中,`driver_name_open()` 函数被注册为设备的 `ndo_open` 成员函数。当用户程序打开网络设备时,内核会自动调用该函数来打开网络设备。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值