Tag Archives: mysql

WordPress “The plugin generated xxxx characters of unexpected output during activation”

11 Sep

Problem I was developing a plugin for wordpress and receive a messsage: The plugin generated 496 characters of unexpected output during activation Solution I placed the following code at the end of my plugin file, update_option(‘plugin_error’,  ob_get_contents()); then looked in the wordpress options table using the query “SELECT * FROM `wp_options` WHERE option_name = ’plugin_error’” Then I could see what [...]

MAMP – MySQL can’t connect after OS X Crash

4 Sep

Problem I had my macbook open, it went to sleep and I couldn’t wake it up.  After holding down the powerbutton for over 10 seconds, it turned on.  Everything was fine until I tried to open the MAMP home page.  MySQL couldn’t start.  the error logs showed: InnoDB: Check that you do not already have [...]

WordPress Deactive Plugin

5 Apr

Problem I had a wordpress site where the public side was fine, but the admin side was throwing a Internal Server Error 500 intermittently.   I couldn’t figure out what was wrong since I had done no changes, and my host said nothing was wrong with the server.  To solve mysterious crashing errors in WordPress, the [...]

mysqldump – Using password: NO error

20 Jan

Problem I need to back up a mysql database on a shared hosting server.  I am using the cron job to run a bash file which runs a mysqlcommand.  The problem is that I can’t get MySQL to recognize the password.  I have no spaces after the “-p” however, I still get the following error: [...]

LemonStand eCommerce Notes

22 Nov

Lemonstand is an eCommerce solution that lets you try before you buy.  It is very simple to use and virtually no learning curve to develop for.  It uses PHP and mySQL.  Check it out for yourself here. Below are just a bunch of notes I jotted down while using and developing for Lemonstand. Docs are [...]

MySQL Auto Backup

4 Aug

The following commands should be run daily.  This will give you a backup for 1 full month.  After 1 month the backups will overwrite the oldest files.  The %d is the day of the month. GoDaddy: In your Hosting Dashboard -> Content -> Chron Manager, enter the following line as the command.  Replace <xxx> with [...]

MySQL UTF-8

12 Jun

Problem: I have a database that needs to accommodate all languages.  Currently it is set to the default latin1_swedish_c1.  I’m thinking I need to change it to UTF8, but there are so many UTF8 encodings!   Solution: “_cs” is for case sensitive collations.  So for case insensitive applications you can use utf8_general_ci.  utf8_bin is binary so it’s [...]

MySQL Query Examples

28 May

MySQL examples and queries: http://www.artfulsoftware.com/infotree/queries.php This great resource showed me a simple way to pivot in MySQL.  If you have the following tables: CREATE TABLE `project` ( `project_id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL, PRIMARY KEY (`project_id`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `project_service` ( `project_id` int(11) NOT NULL, `service_id` int(11) [...]