Activity Stream
48,167 MEMBERS
6722 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1.     
    #1
    Member
    Website's:
    downfreak.com

    Default DLE Huge database deleting outdated post problem

    Hi,
    I am using DLe on my website and the sql database is now 6GB with more than 1 million posts.

    I am having a problem when trying to delete outdated posts or when trying to delete about 100 posts at once the server keep sending "INTERNAL ERROR" message.. and i cant do anything..

    I can only delete posts if i want to do 1 by 1 which will take me for ever to do.

    Anyone know any alternative for it?

    What i was thinking is if any script than exist than i can run and it will delete 1 post per 30 seconds starting from the oldest one? there i can get about (30* 2 * 60) = 3600 posts deleted per hour


    cheers
    downfreak Reviewed by downfreak on . DLE Huge database deleting outdated post problem Hi, I am using DLe on my website and the sql database is now 6GB with more than 1 million posts. I am having a problem when trying to delete outdated posts or when trying to delete about 100 posts at once the server keep sending "INTERNAL ERROR" message.. and i cant do anything.. I can only delete posts if i want to do 1 by 1 which will take me for ever to do. Anyone know any alternative for it? What i was thinking is if any script than exist than i can run and it will delete 1 Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    vaporhostn.com
    a script will have the same issue.. this has to do with your mysql database...

    Best thing to do is find out how dle deletes the tables from mysql... if its all coming from just one table then go into phpmyadmin and change it so it shows the oldest table and delete tables from there...

  4.     
    #3
    Member
    Website's:
    downfreak.com
    Quote Originally Posted by Loonycgb2 View Post
    a script will have the same issue.. this has to do with your mysql database...

    Best thing to do is find out how dle deletes the tables from mysql... if its all coming from just one table then go into phpmyadmin and change it so it shows the oldest table and delete tables from there...
    If the scrip can execute itself every 30 seconds to delete only 1 at a time will not be a problem as it allow me to delete 1 - 2 posts but when i try to delete more than 5, i just keep on getting the internal error message..

    Also am not a php expert so a bit hard for me to find out where all the tables..
    i know it should be in editnews.php but dont know the rest lol

  5.     
    #4
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    You wanted to delete the news by last posted news or first posted news first?

    just coded a quick script to do the task:

    PHP Code: 
    <?php
    /**
     * Developer: Soft2050
     * IDE Used: JetBrains PhpStorm.
     * Date: 10/9/11
     * Time: 2:07 PM
     */

    $dbhost ''// Enter your db host here
    $dbuser ''// Enter db username here
    $dbpass ''// Enter db password here'
    $dbname ''// Enter your db name here

    $connection mysql_connect($dbhost$dbuser$dbpass) or die(mysqli_error());

    mysql_select_db($dbname$connection);

    mysql_query("DELETE FROM `dle_post` LIMIT 1");

    mysql_close($connection);

    ?>
    Set that to cron job and it will take care of the rest!

    Execute this in ssh:
    Code: 
    1 * * * * /filepathhere.php
    This will set the cron to run that script every 1 minute
    Hope it helps

  6.     
    #5
    Member
    Website's:
    downfreak.com
    Quote Originally Posted by soft2050 View Post
    You wanted to delete the news by last posted news or first posted news first?

    just coded a quick script to do the task:

    PHP Code: 
    <?php
    /**
     * Developer: Soft2050
     * IDE Used: JetBrains PhpStorm.
     * Date: 10/9/11
     * Time: 2:07 PM
     */

    $dbhost ''// Enter your db host here
    $dbuser ''// Enter db username here
    $dbpass ''// Enter db password here'
    $dbname ''// Enter your db name here

    $connection mysql_connect($dbhost$dbuser$dbpass) or die(mysqli_error());

    mysql_select_db($dbname$connection);

    mysql_query("DELETE FROM `dle_post` LIMIT 1");

    mysql_close($connection);

    ?>
    Set that to cron job and it will take care of the rest!

    Execute this in ssh:
    Code: 
    1 * * * * /filepathhere.php
    This will set the cron to run that script every 1 minute
    Hope it helps
    hey soft2050, how you been mate?
    haven't seen you for ages?

    by the way from the code that u just coded, is it going to delete the post which was first posted in terms of time when it was posted?

    also it it going to delete infos attributed to the post like number of viewings and comments?

    cheers mate

  7.     
    #6
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by downfreak View Post
    hey soft2050, how you been mate?
    haven't seen you for ages?

    by the way from the code that u just coded, is it going to delete the post which was first posted in terms of time when it was posted?

    also it it going to delete infos attributed to the post like number of viewings and comments?

    cheers mate
    I am fine dude!
    The code is going to delete the post which was posted first

    It will delete the info except the total news shown in user profile! It will still be a bug there! But you can fix it by DLE Database Optimization in admin cp to fix those bugs

  8.     
    #7
    Respected Developer
    Website's:
    wrzc.org
    PHP Code: 
    mysql_query("DELETE FROM `dle_post` LIMIT 1"); 
    You are running a script every single minute to delete one topic. This doesn't make sense. Put it on a 5 minute cron script and change the LIMIT to 5 which will be far more efficient on the server.

    You should really order them as well by time. Yes it should remove older posts first but you want to make sure. I don't use DLE so don't know the name of the time column but you'll need something like this

    PHP Code: 
    mysql_query("DELETE FROM `dle_post` ORDER BY time ASC LIMIT 5"); 
    the time needs to be changed to whatever the time column is called. Another thing you could do to prevent posts which are ranked high in Google from being removed which could seriously affect your traffic is to only DELETE posts with views lower than eg 20.

    PHP Code: 
    mysql_query("DELETE FROM `dle_post` WHERE views < 20 ORDER BY time ASC LIMIT 5"); 
    Again you need to check the correct name for the views column.
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  9.     
    #8
    Member
    Website's:
    downfreak.com
    i tried to run
    <?php
    /**
    * Developer: Soft2050
    * IDE Used: JetBrains PhpStorm.
    * Date: 10/9/11
    * Time: 2:07 PM
    */

    $dbhost = ''; // Enter your db host here
    $dbuser = ''; // Enter db username here
    $dbpass = ''; // Enter db password here'
    $dbname = ''; // Enter your db name here

    $connection = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysqli_error());

    mysql_select_db($dbname, $connection);

    mysql_query("DELETE FROM `dle_post` LIMIT 1");

    mysql_close($connection);

    ?>
    but its not working...

  10.     
    #9
    Member
    Website's:
    downfreak.com
    Any "Respected Developer" was to work on this?
    cheers

  11.     
    #10
    Member
    just run a query in phpmyadmin

    delete all posts below ID 1000, adjust the number to suit you

    PHP Code: 
     DELETE FROM `dle_postWHERE id 1000 
    If it times out it will continue in the background, dont re-start mysql

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Deleting fields from database tables with phpMyAdmin
    By Areon in forum Server Management
    Replies: 0
    Last Post: 17th Mar 2014, 05:16 PM
  2. Backup/Repair Huge Database's VPS/DED
    By Gavo in forum Technical and Security Tutorials
    Replies: 11
    Last Post: 11th Mar 2011, 02:40 PM
  3. [Selling] MegaSoftz.com PR1(Huge DataBase)
    By play_avi in forum Completed Transactions
    Replies: 0
    Last Post: 4th Jul 2010, 08:26 AM
  4. WTB: Huge Warez vbulletin database
    By jackjack in forum Completed Transactions
    Replies: 21
    Last Post: 12th Nov 2008, 03:32 PM
  5. [WTS] Huge Lyrics Database 5$
    By Harshadewa in forum Completed Transactions
    Replies: 2
    Last Post: 8th Oct 2008, 01:47 AM

Tags for this Thread

BE SOCIAL