Skip to main content
deleted 59 characters in body
Source Link
WonderLand
  • 5.7k
  • 7
  • 59
  • 77

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2 **UPDATE **
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

UPDATE 31
I choose to follow the PHP approach (@samitha) for 2 reasons:

  1. STORE PROCEDURE looks more complicated
  2. Query on 'information_schema' table is very slow ( at least if you have many DB/TABLES)

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

UPDATE 3
I choose to follow the PHP approach (@samitha) for 2 reasons:

  1. STORE PROCEDURE looks more complicated
  2. Query on 'information_schema' table is very slow

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

**UPDATE **
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

UPDATE 1
I choose to follow the PHP approach (@samitha) for 2 reasons:

  1. STORE PROCEDURE looks more complicated
  2. Query on 'information_schema' table is very slow ( at least if you have many DB/TABLES)
added 194 characters in body
Source Link
WonderLand
  • 5.7k
  • 7
  • 59
  • 77

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

UPDATE 3
I choose to follow the PHP approach (@samitha) for 2 reasons:

  1. STORE PROCEDURE looks more complicated
  2. Query on 'information_schema' table is very slow

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

UPDATE 3
I choose to follow the PHP approach (@samitha) for 2 reasons:

  1. STORE PROCEDURE looks more complicated
  2. Query on 'information_schema' table is very slow
added 102 characters in body
Source Link
WonderLand
  • 5.7k
  • 7
  • 59
  • 77

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

I'm looking for a straight way to run a query on all databases hosted on my mysql server.

I have a bunch of Magento installations and I want to truncate all Magento log table on all databases:

  • log_customer
  • log_visitor
  • log_visitor_info
  • log_url
  • log_url_info
  • log_quote
  • report_viewed_product_index
  • report_compared_product_index
  • report_event
  • catalog_compare_item

I think it something very easy to accomplish in mysql but I cannot find a straight answer/solution.

UPDATE
I'm interested in pure SQL approach ... so no PHP based solution are welcome

UPDATE 2
According to @Ollie Jones it is not possible to do it without a STORE PROCEDURE or a server side language ( PHP or whatever )

added 93 characters in body
Source Link
WonderLand
  • 5.7k
  • 7
  • 59
  • 77
Loading
no need for "basically" - it's a high tech "um". stop saying and writing it.
Source Link
duffymo
  • 309.5k
  • 46
  • 376
  • 570
Loading
Source Link
WonderLand
  • 5.7k
  • 7
  • 59
  • 77
Loading