View Single Post
Old 01-11-2011, 12:19 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Quote:
Originally Posted by Dido AskJolene View Post
What Barry said... LOAD DATA INFILE is very quick - but you have to have shell access.

With regards to the date splitting, using a regexp is ok - however I think just using explode() will/can be quicker. Especially for something this trivial, it doesn't really require a regexp.

Got root? bash
cron a bash script to do this?

I have never done this but I found this as a protype ...

Code:
#!/bin/bash
P=password
D=database
U=username
mysql -u$U -p$P <<< 'alter database '$D' default character set utf8;'
mysql -u$U -p$P -D$D <<< 'show tables;' | while read x; do mysql -u$U -p$P\
-D$D <<< 'alter table '$x' convert to character set utf8;'; done
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote