Tag Archives: mysql

MYSql copy tables

create table tablename_new like tablename; -> this will copy the structure… insert into tablename_new select * from tablename; -> this would copy all the data

Posted in MySQL | Tagged , | Comments Off

Find and replace in MYSQL

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/’, ” ) ;

Posted in MySQL, Wordpress | Tagged , , , , | Comments Off

MySQL Remove whitespace

update your_table set your_field = trim(your_field)

Posted in MySQL | Tagged , | Comments Off

Create joomla 1.5 admin

This is something I do often enough to not want to google it .. Step 1 Create the new Joomla! User REPLACE INTO `jos_users` (`id`, `name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `gid`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES (’60′, ‘Admin2′, … Continue reading

Posted in Joomla | Tagged , , , | Comments Off

Adding admin user from phpMyAdmin

here: http://www.dnawebagency.com/how-to-add-an-admin-user-to-the-wordpress-database

Posted in Wordpress | Tagged , , | Comments Off

Incrementing values in Mysql

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 … Continue reading

Posted in MySQL | Tagged , | Comments Off

moving data in sql

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(), … Continue reading

Posted in MySQL | Tagged , | Comments Off