access mantis db and some sql for inquiry

The mantis is an open source project for bug tracking.  In our project, the db for mantis is mysql.

We can read the bug information from mantis through browser.

But you might hope to access the mantis db for more advance operation if you need do some complex operation for them.

The steps:

1.  Download a mysql client tools. ( I recommend you to use toad for mysql, you can download it from http://www.quest.com/toad_for_mysql/index.asp, and it's totally free)

2.  Submit a request to Vincent ( HP network Admin in Innolux project) to register your pc for access the mantis db. The only information you need sumbit is your pc name.  If you really need access mantis db in your job, pls let me know your pc name, I will do it for you.

3. Connect to mantisdb with the following information

Host: 172.16.22.32

Database: bugtracker

Username: luke

Pwd: BLANK

4.  Execute your SQL in your mysql client tool

Additionally, you can download myODBC from http://dev.mysql.com/doc/mysql/en/installing-myodbc.html

It can help you to create a ODBC DNS to access mysql database if you wanna write some vb program to access it. E.G. I made a VBA macro to get bug detail information according to bugid in excel file.

Here is a chinese mysql manual: http://netlab.cse.yzu.edu.tw/~statue/cfc/docs/mysqldoc_big5/manual_toc.html

The following sqls is used to query bug detail by date.

SELECT
 a.id, a.severity, a.summary, a.category, a.status,
 a.date_submitted, a.last_updated,b.value,IFNULL(c2.username,'') as assigner,
  c1.username as reporter, a.duplicate_id, prj.name,
  (TO_DAYS(now()) - TO_DAYS(a.last_updated)) as notfollowed
FROM
 mantis_bug_table a left join mantis_user_table c2 on a.handler_id = c2.id,
 bugtracker.mantis_custom_field_string_table b,mantis_user_table c1, mantis_project_table prj
WHERE
     a.ID = b.bug_id
     AND a.reporter_id = c1.id
     AND prj.id = a.project_id
     AND prj.name in ('Beluga MES','Production_Array','Production_Cell','Production_CF')
     AND a.status NOT in (80,85,90)
     AND DATE_FORMAT(a.date_submitted, '%Y-%m-%d') < '2005-01-01'
ORDER by
 a.id desc

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值