Database

Drupal CCK email field errors: "doesn't have a default value query"

Submitted by charles on

Ran into this error a couple of times before when adding content to a CCK email field in MySQL 5.0.27: user warning: Field 'field_email_email' doesn't have a default value query: It seems the email field is initially set up to not allow null values. To fix this check out this patch or just update the field in phpMyAdmin: ALTER TABLE `table_name` CHANGE `field_email_email` `field_email_email` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL

phpMyAdmin "Save as file" file name template

Submitted by charles on
When using phpMyadmin to backup a MySQL database, there is an option near the bottom to save as a file. When you use this option, you can make your life easier by using a file name template that automatically names the backup file for you. By default it is the database name, but I find it useful to put a timestamp on it as well. To do that, use the following in the file name template field: %Y%m%d%H%M%S-__DB__ This will save your files in the following format: 20070815152612-databasename.sql

MySQL case sensitivity of table names between windows and linux systems

Submitted by charles on
While I normally stick to all lowercase table names for my MySQL database tables, I often have to come in on a project where the database has already been set up using a mixture of lower and uppercase table names. Because windows is case-insensitive, when you create a MySQL table or export tables for use on a linux system, all table names will be lowercase by default. This will cause problems when the dump imported into MySQL on linux, as any calls to the original mixed case tables will result in errors, as these tables don't actually exist.