query
Password word token
If you forgot the password of any account but have access to the database. You can put the following token in the "password" field, which is the equivalent of the word "password". Enter your account with the new password and change the password to a more secure one.
TOKEN: $2a$10$d6cd3fba5b68a36e40ba8uk4f2Wx/VSrL9ufd110IPMtetGaLO/cS
Converting time stamps in excel to dates
=(((COLUMN_ID_HERE/60)/60)/24)+DATE(1970,1,1)Find and replace string in database
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'text to find here', 'text to replace here');Search and replace in db
update table_name set field_name = replace(
field_name, 'original text',
'replacement text');Restoring your MySQL Database
$ mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]Note: this is for Simple Invoices 2010.2 and above
Say you want the have the invoice number start at 1000 instead of 1
Open phpMyAdmin, go to your Simple Invoices database, then find the si_index table. Then click browse, the data should look something like
Simplenews - How to subscribe all existing users?
To add all users that are not already subscribers run this query:
insert into simplenews_subscriber(activated, mail, uid) select 1, mail, uid from users where uid not in (select uid from simplenews_subscriber) and uid > 0;And to subscribe them to a newsletter run this query:
How to mysqldump remote db from local machine
mysqldump -P 3310 -h 127.0.0.1 -u mysql_user -p database_name table_nameExample:
mysqldump -h us-cdbr-azure-east-c.cloudapp.net -u b44cda8e436b5c -p MetaVisionMySQL > MetaVisionMySQL.sqlEmptying a database (alternative method)
USE database name you want delete;
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables
FROM information_schema.tables
WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET FOREIGN_KEY_CHECKS = 1;
If you need to delete views
Empty a database
mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD -BNe "show tables" YOUR_DBSCHEMA_NAME | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD YOUR_DBSCHEMA_NAME
