As of MySQL 5.1.12, you can rename the general query log file at runtime by disabling the log: SET GLOBAL general_log = ‘OFF’; With the log disabled, rename the log file externally; for example, from the command line. Then enable the log again: SET GLOBAL general_log = ‘ON’; This method works on any platform and
Continue reading: MySQL query logging
create table tablename_new like tablename; -> this will copy the structure… insert into tablename_new select * from tablename; -> this would copy all the data
Updating Data in MYSql update [table_name] set [field_name] = replace([field_name],'[string_to_find]’,'[string_to_replace]’); For moving wordpress installs to repair the guid UPDATE wp_posts SET guid = replace( guid, ‘web/’, ” ) ;
update your_table set your_field = trim(your_field)
As the saga continue manipulating data this comes in handy to increment all the id’s in a table UPDATE jos_content_old SET id = id + 50 WHERE (id = id) Keep in mind the resulting id being set must be higher thatn any existing ones or ther will be an error.
So after searching around the web looking for code to get data from one table intop another I found this example posted on the mysl dev forum mysql> INSERT INTO orders (customer_cust_id, orderdatetime, message, taxrate, shippingprice) -> SELECT ‘1’, NOW(), null, taxrate, shippingprice FROM customer -> WHERE cust_id=’1′; Query OK, 1 row affected (0.01 sec)
Continue reading: moving data in sql