Send Motion-user mailing list submissions to motion-user@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/motion-user or, via email, send a message with subject or body 'help' to motion-user-requ...@lists.sourceforge.net You can reach the person managing the list at motion-user-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Motion-user digest..." Today's Topics: 1. Re: Not writing to database (genius3000) 2. Re: Not writing to database (MrDave) ---------------------------------------------------------------------- Message: 1 Date: Fri, 9 Nov 2018 13:56:41 -0700 From: genius3000 <genius3000+motion@g3k.solutions> To: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Not writing to database Message-ID: <007e206b-b43a-4db8-956c-c1a4bec94441.maildroid@localhost> Content-Type: text/plain; charset="utf-8" >>> It's as if Motion is ignoring any database directives. My first thought with that is to ensure you're compiling with MySQL support. Most of the database code only compiles when any of the three DBs are defined and then specifically to each one. Try re-running configure to be sure MySQL support is yes. If that's not the issue, try running motion with debug logging (iirc, at least INF level) and hopefully we can get some helpful information. </genius3000> -----Original Message----- From: David Powell <da...@depowell.com> To: Motion discussion list <Motion-user@lists.sourceforge.net> Sent: Fri, 09 Nov 2018 1:37 PM Subject: Re: [Motion-user] Not writing to database I tried adding the */sql_query_start/* but it didn't help. It's as if Motion is ignoring any database directives. I tried checking the logs in MySQL but can't seem to read them for some reason (I suppose they're encrypted, but the MySQL workbench is being persnickety about showing them to me. Cat-ing the MySQL log files shows only hieroglyphics). I'm sure the problem is not in MySQL because I can use that same query to insert rows into the database using SQuirreL without any problems. David On 11/9/18 1:56 PM, Mike Wilson wrote: > The goal has always been to support that case, but there could be a > bug related to the changes to support tying the events together for > video and pictures. I use: > > sql_query insert into security_file(camera, event_id, filename, frame, > file_type, time_stamp) values('%t', '%{dbeventid}', '%f', '%q', '%n', > '%Y-%m-%d %T') > sql_query_start insert into security_events (camera, event_time_stamp) > values('%t', '%Y-%m-%d %T') > > This might help you. It is worth a try if nothing else. If this does > work and the query alone doesn't, I would be sure to file a bug so we > can sort that out. > > What I'm doing here with sql_query_start is generating an event in my > security_events table and then using the ID that it generates to tag > each video and picture so I don't have to guess later on my front-end. > > On Fri, Nov 9, 2018 at 2:49 PM David Powell <da...@depowell.com > <mailto:da...@depowell.com>> wrote: > > This database issue is driving me nuts. I'm using version > 4.1.1+git20181002-062a328 of Motion and everything seems to work OK, > except it won't write events to the MySQL database. I'm sure it's > something I'm not doing right but I can't see it. There are no > errors in > the log at any logging level. I have the config file set with: > > database_type mysql > database_dbname cameras > database_host localhost > database_port 3306 > database_user root > database_password <redacted> > database_busy_timeout 0 > sql_log_picture on > sql_log_snapshot off > sql_log_movie on > sql_log_timelapse off > sql_query INSERT INTO cameras.events > > (server_number,camera_number,event_number,event_date,video_length,filename) > > VALUES (2,%t,%v,{ts '%C'},null,'%v-%Y%m%d%H%M%S'); > > Nothing gets written to the database, and no errors are reported > in the > log file. What am I doing wrong? > > David > > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > <mailto:Motion-user@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 2 Date: Fri, 9 Nov 2018 18:55:36 -0700 From: MrDave <motionmrd...@gmail.com> To: motion-user@lists.sourceforge.net Subject: Re: [Motion-user] Not writing to database Message-ID: <cace3b09-32f7-3c08-7e2e-b9f993993...@gmail.com> Content-Type: text/plain; charset="utf-8"; Format="flowed" I would suggest trying to put in a INCORRECT user or password and validate that the log? reports "Cannot connect to MySQL database %s on host %s with user %s" If Motion does report that message, then we know that Motion is connecting to the database.? If it does not report that message, then that means that Motion did not find the mysql packages when it was compiled.? Per the message from genius3000, you'd then need to go back to ./configure and check the messages. Dave On 11/9/2018 2:07 PM, Mike Wilson wrote: > Well, that is good progress and good to know we don't need an issue > over it. Let us know what you?find out. > > On Fri, Nov 9, 2018 at 3:37 PM David Powell <da...@depowell.com > <mailto:da...@depowell.com>> wrote: > > I tried adding the */sql_query_start/* but it didn't help.? It's > as if Motion is ignoring any database directives.? I tried > checking the logs in MySQL but can't seem to read them for some > reason (I suppose they're encrypted, but the MySQL workbench is > being persnickety about showing them to me. Cat-ing the MySQL log > files shows only hieroglyphics). > > I'm sure the problem is not in MySQL because I can use that same > query to insert rows into the database using SQuirreL without any > problems. > > David > > > On 11/9/18 1:56 PM, Mike Wilson wrote: >> The goal has always been to support that case, but there could be >> a bug related to the changes to support tying the events together >> for video and pictures. I use: >> >> sql_query insert into security_file(camera, event_id, filename, >> frame, file_type, time_stamp) values('%t', '%{dbeventid}', '%f', >> '%q', '%n', '%Y-%m-%d %T') >> sql_query_start insert into security_events (camera, >> event_time_stamp) values('%t', '%Y-%m-%d %T') >> >> This might help you. It is worth a try if nothing else. If this >> does work and the query alone doesn't, I would be sure to file a >> bug so we can sort that out. >> >> What I'm doing here with sql_query_start is generating an event >> in my security_events table and then using the ID that it >> generates to tag each video and picture so I don't have to guess >> later on my front-end. >> >> On Fri, Nov 9, 2018 at 2:49 PM David Powell <da...@depowell.com >> <mailto:da...@depowell.com>> wrote: >> >> This database issue is driving me nuts.? I'm using version >> 4.1.1+git20181002-062a328 of Motion and everything seems to >> work OK, >> except it won't write events to the MySQL database. I'm sure >> it's >> something I'm not doing right but I can't see it. There are >> no errors in >> the log at any logging level. I have the config file set with: >> >> database_type mysql >> database_dbname cameras >> database_host localhost >> database_port 3306 >> database_user root >> database_password <redacted> >> database_busy_timeout 0 >> sql_log_picture on >> sql_log_snapshot off >> sql_log_movie on >> sql_log_timelapse off >> sql_query INSERT INTO cameras.events >> >> (server_number,camera_number,event_number,event_date,video_length,filename) >> >> VALUES (2,%t,%v,{ts '%C'},null,'%v-%Y%m%d%H%M%S'); >> >> Nothing gets written to the database, and no errors are >> reported in the >> log file.? What am I doing wrong? >> >> David >> >> >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> <mailto:Motion-user@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe: >> https://lists.sourceforge.net/lists/options/motion-user >> >> >> >> _______________________________________________ >> Motion-user mailing list >> Motion-user@lists.sourceforge.net >> <mailto:Motion-user@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/motion-user >> https://motion-project.github.io/ >> >> Unsubscribe:https://lists.sourceforge.net/lists/options/motion-user > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > <mailto:Motion-user@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user > > > > > > _______________________________________________ > Motion-user mailing list > Motion-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/motion-user > https://motion-project.github.io/ > > Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------ Subject: Digest Footer _______________________________________________ Motion-user mailing list Motion-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/motion-user ------------------------------ End of Motion-user Digest, Vol 149, Issue 12 ********************************************