{"action":"created","issue":{"url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/11","repository_url":"https://api.github.com/repos/Tencent/bk-cmdb","labels_url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/11/comments","events_url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/11/events","html_url":"https://github.com/Tencent/bk-cmdb/issues/11","id":197120932,"number":11,"title":"执行 php index.php /cli/Init/initUserData  报错如下：","user":{"login":"xingliguang","id":24713062,"avatar_url":"https://avatars.githubusercontent.com/u/24713062?v=3","gravatar_id":"","url":"https://api.github.com/users/xingliguang","html_url":"https://github.com/xingliguang","followers_url":"https://api.github.com/users/xingliguang/followers","following_url":"https://api.github.com/users/xingliguang/following{/other_user}","gists_url":"https://api.github.com/users/xingliguang/gists{/gist_id}","starred_url":"https://api.github.com/users/xingliguang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xingliguang/subscriptions","organizations_url":"https://api.github.com/users/xingliguang/orgs","repos_url":"https://api.github.com/users/xingliguang/repos","events_url":"https://api.github.com/users/xingliguang/events{/privacy}","received_events_url":"https://api.github.com/users/xingliguang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-22T08:35:05Z","updated_at":"2016-12-22T09:20:37Z","closed_at":null,"body":"begin truncate table\r\nend truncate table\r\nbegin create classify host property \r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('1', 'AssetID', '固资编号', 'basic', 'AssetID','12', '2016-02-24 11:26:57', '2016-02-24 18:00:57')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('7', 'DeviceClass', '设备类型', 'basic', 'DeviceClass','11', '2016-02-24 17:24:04', '2016-02-24 18:01:24')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('8', 'HostName', '主机名称', 'basic', 'HostName', '6','2016-02-24 17:26:00', '2016-02-24 18:01:48')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('9', 'Status', '运行状态', 'basic', 'Status', '7','2016-02-24 18:02:23', '2016-02-25 14:45:38')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('10', 'Operator', '维护人', 'basic', 'Operator','3', '2016-02-24 18:02:41', '2016-02-24 18:03:14')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('11', 'BakOperator', '备份维护人', 'basic', 'BakOperator','4', '2016-02-24 18:03:37', '2016-02-24 18:03:37')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('12', 'InnerIP', '内网IP', 'basic', 'InnerIP','1', '2016-02-24 18:04:01', '2016-02-24 18:04:01')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('13', 'OuterIP', '外网IP', 'basic', 'OuterIP','2', '2016-02-24 18:04:31', '2016-02-24 18:04:31')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('14', 'OSName', '操作系统', 'basic', 'OSName','7', '2016-02-24 18:04:53', '2016-02-24 18:04:53')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('15', 'Description', '备注', 'basic', 'Description','13', '2016-02-24 18:05:10', '2016-02-24 18:05:10')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('16', 'ZoneName', '可用区', 'basic', 'ZoneName','15', '2016-02-24 18:05:39', '2016-02-24 18:05:39')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('17', 'ZoneID', '可用区ID', 'basic', 'ZoneID', '14','2016-02-24 18:06:07', '2016-02-24 18:06:07')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('47', 'CreateTime', '入库时间', 'basic', 'CreateTime', '17','2016-02-24 19:11:25', '2016-02-24 19:11:25')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('49', 'Region', '机房城市', 'basic', 'Region','16', '2016-02-24 19:12:21', '2016-02-24 19:12:21')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('51', 'Cpu', 'Cpu', 'basic', 'Cpu', '8','2016-02-24 19:13:12', '2016-02-24 19:13:12')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('52', 'Mem', '内存', 'basic', 'Mem', '9','2016-02-24 19:13:37', '2016-02-24 19:13:37')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('60', 'HostID', '主机ID', 'basic', 'HostID','0', '2016-02-24 19:16:54', '2016-02-24 19:16:54')\r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('72', 'ModuleName', '模块名称', 'basic', 'ModuleName','5', '2016-02-24 18:02:41', '2016-02-24 18:02:41')\r\nend create classify host property  \r\nbegin create set property \r\nINSERT INTO `cc_HostPropertyClassify` VALUES ('72', 'ModuleName', '模块名称', 'basic', 'ModuleName','5', '2016-02-24 18:02:41', '2016-02-24 18:02:41')\r\nend create set property  \r\nbegin create admin user \r\nend create admin user \r\nbegin create resource pool \r\n\r\nDatabase error: A Database Error Occurred\r\n\r\n        Error Number: 1364\r\n        Field 'LifeCycle' doesn't have a default value\r\n        INSERT INTO `cc_ApplicationBase` (`ApplicationName`, `Creator`, `CreateTime`, `Default`, `Display`, `Level`, `Maintainers`, `Owner`, `Type`, `Source`, `CompanyID`) VALUES ('资源池', '公司名称', '2016-12-22 15:31:13', 1, 1, 2, '公司名称', '公司名称', 0, 0, 0)\r\n        Filename: models/ApplicationBaseModel.php\r\n        Line Number: 88\r\n然后到数据库为LifeCycle设置默认值：\r\nalter table cc_ApplicationBase modify column `LifeCycle` varchar(16) NOT NULL DEFAULT '100';\r\n再次执行php index.php /cli/Init/initUserData ，继续报错如下：\r\nField 'ProductPm' doesn't have a default value\r\n重新修改，然后继续执行，继续报错…………\r\n后来终于将没有报错信息了，执行php index.php /cli/Init/initUserData 提示：\r\nskip init data\r\n环境描述：\r\nCentos 6.6 x86_64 \r\n软件都是编译安装，按照说明的参数来编译的，都编译OK的！\r\nnginx 1.10.2  \r\nphp  5.6.29\r\nmysql 5.6.19 二进制安装 \r\n测试php和mysql的连通也是测试OK的!麻烦有空请解答关于描述的问题，万分感谢!"},"comment":{"url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/comments/268755192","html_url":"https://github.com/Tencent/bk-cmdb/issues/11#issuecomment-268755192","issue_url":"https://api.github.com/repos/Tencent/bk-cmdb/issues/11","id":268755192,"user":{"login":"Fchrisqing","id":18135745,"avatar_url":"https://avatars.githubusercontent.com/u/18135745?v=3","gravatar_id":"","url":"https://api.github.com/users/Fchrisqing","html_url":"https://github.com/Fchrisqing","followers_url":"https://api.github.com/users/Fchrisqing/followers","following_url":"https://api.github.com/users/Fchrisqing/following{/other_user}","gists_url":"https://api.github.com/users/Fchrisqing/gists{/gist_id}","starred_url":"https://api.github.com/users/Fchrisqing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fchrisqing/subscriptions","organizations_url":"https://api.github.com/users/Fchrisqing/orgs","repos_url":"https://api.github.com/users/Fchrisqing/repos","events_url":"https://api.github.com/users/Fchrisqing/events{/privacy}","received_events_url":"https://api.github.com/users/Fchrisqing/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T09:20:37Z","updated_at":"2016-12-22T09:20:37Z","body":"这个情况的出现主要是mysql不同版本的兼容问题，需要刷新一下初始化脚本"}}
{"actor":{"display_login":"Fchrisqing"}}