Feb 032009
 

Quick and dirty commands from commandline:

mysql -u <user> -p<password>
mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO ‘wpuser’@’localhost’ IDENTIFIED BY ‘dbpassword’;
mysql> SET PASSWORD FOR ‘wpuser’@’localhost’ = OLD_PASSWORD(‘dbpassword’);
mysql> FLUSH PRIVILEGES;
mysql> quit;

Dec 102008
 

It happens sometimes that due to database migration, you see spurious characters in MySQL tables and you would like to intervene massively (thick for instance to forums) and replace them with proper characters.

Luckily this is easily doable if you manage to have connection to DB with command line interface or web based system allowing you to issue SQL statements.

Command to use is:

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);