Archive for the ‘SQL’ Category

Assigning privileges to a user on MySQL DB

Tuesday, February 3rd, 2009

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'; ...

Replace characters in MySQL

Wednesday, December 10th, 2008

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 ...

Cleanup SPAM users in PHPBB2

Friday, December 5th, 2008

Once you have access to DB, the SQL string is: DELETE FROM phpbb_users WHERE user_active=0 AND user_id>0 This will cleanup all the users marked as non active, thus most likely spam.