posted this in Admin, MYSQL, php, Wordpress on December 4th, 2012 Goal: Update wordpress post with PHP cli
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
< ?php $con = mysql_connect("localhost","root","[redacted]"); if (!$con) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("wordpress")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $myfileText = mysql_real_escape_string(file_get_contents('./code_for_wordpress.html',true)); $sql = "UPDATE `[your_instance_prefix]_posts` SET `post_content` = '$myfileText' WHERE `ID` like '1397';"; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } mysql_close($con); ?> |
posted this in FreeBSD, MYSQL on November 17th, 2011 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
posted this in Active Directory, Scripts on October 30th, 2010 Scripts to manage Active Directory Users
Appending a Multi-Valued Attribute Appending a Phone Number Adding a Route to the Dial-In Properties of a User Account Adding a User to Two Security Groups Appending Address Page Information for a User Account Appending a Home Phone Number to a User Account Assigning a Published Certificate to a . . . → Read More: useful active directory scripts
posted this in Linux, O/S on October 30th, 2010 Useful Linux Commands (Red Hat)
(http://www.cse.buffalo.edu/~eisner/DLW) Revised 3/1/2000
Getting information man commandname display the manual page for a particular command named commandname man -S sectionnumber commandname display the manual page under a specific section numbered sectionnumber for the command named commandname. Sometimes the same command will exist in more than one section. man alone will . . . → Read More: Red Hat Linux cheat sheet commands examples RHEL
posted this in FreeBSD, MYSQL on July 9th, 2010 Problem: receiving this error on freebsd 6.1
|
|
(Can't contact the database server: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (localhost)) |
To investigate run this command:
If mysql is not running then start it like this:
|
|
# /usr/local/etc/rc.d/mysql-server start |
posted this in MYSQL, Scripts, Windows on June 26th, 2010 Below I will explain how to take nightly backups of your MySQL database Download and Install: MYSQL GUI Tools 7zip Windows Server 2003 Resource Kit Tools to obtain robocopy
After you install the tools bring up a command prompt and run these commands to copy robocopy to our working folder (1BACKUP_MYSQL):
|
|
cd \ cd .. cd \ c: mkdir 1BACKUP_MYSQL copy "C:\Program Files\Windows Resource Kits\Tools\robocopy.exe" C:\1BACKUP_MYSQL |
Creating a MySQL . . . → Read More: Howto: Backup your Bitnami Stack’s MySQL DB
posted this in MSSQL, Windows on June 25th, 2010 Problem: Redmine is running super slow. Version: Bitnami Redmine Stack on Windows The Fix 1. Run MySQL System Tray Monitor (accessible from either of these methods):
Start menu – MySql – MySQL System Tray Monitor “C:\Program Files\MySQL\MySQL Tools for 5.0\MySQLSystemTrayMonitor.exe”
2. Right click on system tray icon and from the popup menu select Actions -> . . . → Read More: Howto: Fix a Slow Bitnami Redmine Stack
|
|