Jump to content

[Solved] Invisible Database


dl5ark1

Recommended Posts

The database dl5ark_smart-home should now be visible to your root mysql account. You may need to delete, recreate, and reassign permissions to any database users that should have access to the affected database. If phpmyadmin doesn't log in properly or you don't see the database there change your account password and this should sync up the mysql/cpanel passwords. Let us know if you're still having any issues accessing your data.

 

dl5ark_blitzortung by itself exceeds your total account storage by 480%. What are your plans to reduce its size?

Link to comment
Share on other sites

dl5ark_blitzortung has been restored in its entirety, but you need to clear out some of the data yourself as soon as possible. I'll check back on it in a few days to make sure it's 500mb or less. I would also highly recommend you add some mechanism for deleting old data to make sure this doesn't happen again. Perhaps a weekly cron that runs a script which deletes all entries older than X days or something? I'll leave the implementation up to you. Ridiculous databases like yours are part of the reason Stevie mysql has been so unstable lately. Let us know if you need any help with how to clean up the database, or implementing ways to keep your databases sane in the future.

Link to comment
Share on other sites

dl5ark_blitzortung: 5.0M

Looks much better.

 

DELETE FROM dl5ark_blitzortung.mybo_strikes WHERE time < DATE_SUB(NOW(), INTERVAL 42 DAY);

should work. Obviously you should run it as a SELECT first to make sure it's working correctly. Also make sure you don't typo 'DAYS' instead of 'DAY'. I always do that because '42 DAY' isn't grammatically correct English, but it will throw an error. If it was me I'd put that query into a php script, and then call it once in a while with a cron. You can also just add it to your script that inserts the data and that will be a bit simpler.

Link to comment
Share on other sites

  • 3 weeks later...

DELETE FROM dl5ark_blitzortung.mybo_strikes WHERE time < NOW() - INTERVAL 42 DAY;

works (today) with "0 Datensätze gelöscht. (Die Abfrage dauerte 0.0225 Sekunden)".

But when i run this within Heliohost Cron Jobs i get

/usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `('

/usr/local/cpanel/bin/jailshell: -c: line 0: `DELETE FROM dl5ark_blitzortung.mybo_strikes WHERE time < NOW() - INTERVAL 42 DAY'

Link to comment
Share on other sites

A cron runs on the command line, not within MySQL. The easiest way to accomplish what you're trying to do is create a php file that runs that delete query with a name like cron.php. Then the cron command would be something like

php /home/dl5ark/cron.php

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...