php mysql update variable

Goal: Update wordpress post with PHP cli

mysql insert cdn sync tool

To manually update the CDN Sync Tool table (for wordpress plugin CDN Sync Tool) try this MySQL Insert Statement:

Replace the id with the latest id on your table

To confirm your work:

howto move mysql freebsd without dump

to move mysql on freebsd without using a dump file follow these steps:

stop mysql copy /var/db/mysql to its new location chown -R mysql:mysql modify /etc/rc.conf and add line mysql_dbdir=”“ modify /usr/local/etc/rc.d/mysql-server and change mysql_dbdir=”/var/db/mysql” to the new location of your mysql directory Start up mysql:  /usr/local/etc/rc.d/mysql-server start

rename mysql schema

How can you rename a mysql Schema?

easy!

Create the new schema

In this example the new schema is called my_new_schema

Dump the old schema and pipe in to new schema

ssh port forwarding example

mysql_ssh_port_forward

A ssh port forwarding example would be to map a remote host’s 3306 port to your local machines 3306 port over ssh.

Remote Host: 192.168.0.1 Your Host: localhost

To port forward a mysql connection on a remote host to your local host you would run:

Once this is mapped you can use MySQL Workbench . . . → Read More: ssh port forwarding example

convert ascii mysql db to utf8

how to convert ascii mysql db to utf8 ?

I had a MyISAM mediawiki 1.11.0 database that needed to be utf8 to upgrade to the latest version. Before I could upgrade it I had to convert it to utf8.

Here’s the steps on FreeBSD:

redmine all users projects query

Ever needed to get all projects associated with every user in redmine?  Here’s a query that will help

Multiple Joins sql query; To get user, all projects associated with user and role on that project.

 Exmaple:

Table

Column Names

. . . → Read More: redmine all users projects query

Redmine Alert on New Admin or Public Project

Problem: How can I receive an email when the Redmine admin list changes or a project is changed to publicly viewable? You will need to run some mysql commands / queries in windows batch mode.

Solution:

Download blat and place in c:\windows\system32 Create directory c:\1admin and place these files in it:

These are the queries . . . → Read More: Redmine Alert on New Admin or Public Project

Howto Backup your Bitnami Instance to a Remote Site for Free

Howto Backup your Bitnami Instance to a Remote Site for Free What you’ll need 1. Install dropbox to c:\My Dropbox 2. The names of the services bitnami uses (from command line type net start to get list of services) 3. A new local user in the administrator group that will just be used to run . . . → Read More: Howto Backup your Bitnami Instance to a Remote Site for Free