d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help With Cron Jobs
Add Reply New Topic New Poll
Member
Posts: 42,611
Joined: Oct 28 2013
Gold: 100.00
Mar 31 2016 05:39pm
Trying to use a php file to truncate a table in mySQL database every minute but I cant figure it out.

Anyone have experience with dreamhost

This post was edited by TrialErorr on Mar 31 2016 05:40pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 31 2016 06:06pm
why not just do it in mysql?

Code
SET GLOBAL EVENT_SCHEDULER = ON;
CREATE EVENT truncate some_table_name
ON SCHEDULE EVERY 1 MINUTE
DO
TRUNCATE TABLE 'some_table_name';
Member
Posts: 42,611
Joined: Oct 28 2013
Gold: 100.00
Mar 31 2016 06:40pm
Quote (carteblanche @ Mar 31 2016 07:06pm)
why not just do it in mysql?

Code
SET GLOBAL EVENT_SCHEDULER = ON;
CREATE EVENT truncate some_table_name
ON SCHEDULE EVERY 1 MINUTE
DO
TRUNCATE TABLE 'some_table_name';


trust me i tried this
it gives me a error saying i need SUPER access

the only way i think it works with my hosting is Cron JOBS
iv literally spent hours trying to figure this out


this isnt hw btw, this is just something im doing on my own

This post was edited by TrialErorr on Mar 31 2016 06:42pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 31 2016 07:28pm
Member
Posts: 3,876
Joined: Aug 10 2006
Gold: 22,228.29
Apr 10 2016 11:46am
Quote (TrialErorr @ 1 Apr 2016 00:40)
trust me i tried this
it gives me a error saying i need SUPER access

the only way i think it works with my hosting is Cron JOBS
iv literally spent hours trying to figure this out


this isnt hw btw, this is just something im doing on my own




You have access to cron tab but you can not set user with enough privileges in mysql?

Crontab script also require user with proper privileges in mysql.
System root != mysql root
Member
Posts: 42,611
Joined: Oct 28 2013
Gold: 100.00
Apr 10 2016 03:08pm
Quote (dorkan @ Apr 10 2016 12:46pm)
You have access to cron tab but you can not set user with enough privileges in mysql?

Crontab script also require user with proper privileges in mysql.
System root != mysql root


its all good i got it to work
but now i have a different problem that im trying to figure out
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll