Jump to content
  • 0

MySQL queries not working.


SupremeHorse

Question

10 answers to this question

Recommended Posts

  • 0

Host: Vilayer

Wanting to clear up unused vehicles (Untouched within 14 days)

Tested some queries such as refuel all vehicles and fix all vehicles but nothing worked, even after restart.

Please help :/

Used Navicat Lite and HeidiSQL

MySQL > Epoch > Queries

Do you get a error?

What is the queries you try to run?

Link to comment
Share on other sites

  • 0

Do you get a error?

What is the queries you try to run?

No i don't get any errors. All execute successfully. 

No difference in-game though :s

Tried the following:

- Fix all vehicles (No refuel)

UPDATE instance_vehicle SET damage=0, parts = '[]'

- Fix and refuel all vehicles

UPDATE instance_vehicle SET  fuel=1, damage=0, parts = '[]'

- Refuel all vehicles

UPDATE instance_vehicle SET fuel=1

- Remove vehicles untouched within 30 days

DELETE FROM instance_vehicle WHERE DATE(`last_updated`) < CURDATE() - INTERVAL 30 DAY

 

Link to comment
Share on other sites

  • 0

Epoch database doesn't use instance_vehicle.

 

Try this:

update object_data set hitpoints='[]',fuel=1,damage=0 WHERE `Classname` NOT IN ('VaultStorage','LockboxStorage','VaultStorageLocked','LockboxStorageLocked','WoodShack_DZ','StorageShed_DZ','TentStorageDomed','TentStorageDomed2','TentStorage')  AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL;
Link to comment
Share on other sites

  • 0

It worked! Thank you! 

Now i'm trying to set up a schedule so that objects untouched within 30 days are removed every 14 days, but i keep getting this error:

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON SCHEDULE EVERY 14 DAY COMMENT 'Removes old objects and vehicles' DO DELETE FR' at line 1


The code im using is this:
ON SCHEDULE EVERY 14 DAY COMMENT 'Removes old objects and vehicles' DO DELETE FROM `object_data` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 30 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 30 DAY)


I'm following this guide, just changing the intervals:
http://dayzepoch.com/wiki/index.php/Server_Installation_Instructions_Extended

Please help :)
 
Link to comment
Share on other sites

  • 0

You need to set the number of cleanup days in your hiveext.ini file:

[Objects]
;Which table should the objects be stored and fetched from ?
Table = object_data

;Negative values will disable this feature
;0 means that ALL empty placed items will be deleted every server restart
;A positive number is how old (in days) a placed empty item must be, in order for it to be deleted
CleanupPlacedAfterDays = 21
Link to comment
Share on other sites

  • 0

Dang it! I stoped the server I went to phpmyadmin and went to trade data, with Trade Data open, I ran the script with the SQL box clear and it went green (no error).   I did this with the server off than started it.  At the wholesaler and this man haz no C.Boxes as he did not yesterday.  i'm going try it again

Link to comment
Share on other sites

  • 0

do you use vent or one them talk programs?  I would even donate to your sever for helping me if we could maybe have you come in with me set a couple things?  I hate to admit it but I do not have a clue how to set up a schedule.  Haha, this simple script is giving me all these problems.  If your up for it i'll love have you do that, just let meh know:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...