Remove specified folders form mysql

Hy, i need to remove a folder from my mysql database because it take to much place, its phpmyadmin, i have disabled logging for that folder, anyone can give me a mysql query to remove that ?

For example i want to remove all entries that have “http://somesite.com/phpmyadmin” as url, from the databse, the entries are located in the main website i cannot delete the entire website i need to delete just these entries, its possible to do that ?

Thanks in advance.

Wow! You are a hacker’s dream! “http://somesite.com/phpmyadmin” That is going to get you into a lot of trouble!

phpMyAdmin should be installed in a separate directory, using SSL for the ONE domain using it. If your MySQL database is ‘localhost’, then the username and password per database will be enough to limit that person to the database( s ) with that same user/pass.

Now to your question:

BACKUP YOUR DATABASE!

You will have to run something like this:


DELETE FROM `tablename`
WHERE field1 LIKE '%phpMyAdmin%' 
OR field2 LIKE '%phpMyAdmin%'
... ( [i]keep listing relevant fields until the last one[/i] )
OR Lastfield LIKE '%phpMyAdmin%'

You will have to do this for every table, and insert every relevant field into the query.

Hope that helps! :wink:

Sven2157

I found a solution :),

To find what you want


SELECT lact.name as URL, count(idlink_va) as Count FROM piwik_log_link_visit_action AS act 
JOIN piwik_log_action as lact 
WHERE act.idaction_url = lact.idaction 
AND lact.name LIKE '%phpmyadmin%' # URL to search
GROUP BY lact.name
HAVING COUNT(idlink_va) > 500 # Minimum occurences to be displayed
LIMIT 200;

To delete the entries


DELETE act.* FROM piwik_log_link_visit_action act 
JOIN piwik_log_action as lact 
WHERE act.idaction_url = lact.idaction 
AND lact.name LIKE '%phpmyadmin%';


DELETE FROM piwik_log_action
WHERE name LIKE '%phpmyadmin%';