Sunday, December 5, 2010

Empty < p> paragraph and < br /> removes in Wordpress tinyMCE editor

Do you want a empty line break and you are having the problem that p paragraphs and br are removing / stripping out in your posts in Wordpress? So had I.

The solution to get around this problem was however very simple and one way to solve this was to add the TinyMCE Advanced plugin and then check the box, "Stop removing the p and br tags when saving and show them in the HTML editor".

Easy fix

Friday, December 3, 2010

Non case and case sensitive MySQL tabels

MySQL table names are sometimes case sensitive depending on what configuration you have and if you are running in a Unix or Windows environment.
What controls if it's non case or case sensitive is a setting in my.cnf (my.ini in Windows)

What you'll be looking for if lower_case_table_names is set in your my.cnf
However if you haven't specified the default value of lower_case_table_names , then they are:
  • Unix environment the default value is 0
  • Windows the default value is 1
  • Mac OS X, the default value is 2
You can also make a SQL query to check the current settings, by doing this query:
show variables like "%lower%"

If you don't want to have a non case sensitive setting then lower_case_table_names should be set to:
lower_case_table_names = 1
If you want it to be case sensitive then the settings should be 2.
Save your changes in my.cnf then restart your mysql server so the new configuration will be applied.

MySQL problem, Thread stack overrun: * bytes used of a * byte stack, and * bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack

Are you getting this problem when running custom SQL in phpmyadmin or in the mysql error log? Or maybe if you catch the exception in a programming language like ie php.

One exempel of a problem when requesting data from the database:

#1436 - Thread stack overrun: 5012 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack.


The solution here is to specify a bigger stack as said. One way to do this is to edit your my.cnf file for mysql. You normally will do find the file in Linux at this location: /etc/my.cnf or: /etc/mysql/my.cnf
The location can wary, and sometimes you may not even have a my.cnf then you need to create one.

Open my.cnf in your preferred editor, like vim. And then change or add a line that are higher than the demanded stack size.
You'll be looking for a line like this in your cnf-file:


thread_stack = 192K


Change the thead_stack to a bigger size than what it's specified. If you can't find this line, add it.

After this you'll need to restart mysqld so the changes will apply.

"When the thread stack is too small, this limits the complexity of the SQL statements which the server can handle, the recursion depth of stored procedures, and other memory-consuming actions"