failed with error
code "BLOB/TEXT column 'user_password' can't have a default value
(localhost)".
I think it may be my install of mysql, but I am not sure what to do if it
is.
My server is running the following
Windows XP
Apache/2.0.59 (Win32)
PHP/5.1.6
MySql version: 5.0.26-community-nt
Couldn't reproduce the error, using MySQL 5.0.22 on Linux:
--------------------------------------------
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1609072 to server version: 5.0.22-Debian_0ubuntu6.06.2-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE TABLE `user1` (
-> user_id int(5) unsigned NOT NULL auto_increment,
-> user_name varchar(255) binary NOT NULL default '',
-> user_real_name varchar(255) binary NOT NULL default '',
-> user_password tinyblob NOT NULL default '',
-> user_newpassword tinyblob NOT NULL default '',
-> user_email tinytext NOT NULL default '',
-> user_options blob NOT NULL default '',
-> user_touched char(14) binary NOT NULL default '',
-> user_token char(32) binary NOT NULL default '',
-> user_email_authenticated char(14) binary,
-> user_email_token char(32) binary,
-> user_email_token_expires char(14) binary,
-> user_registration char(14) binary,
-> PRIMARY KEY user_id (user_id),
-> UNIQUE INDEX user_name (user_name),
-> INDEX (user_email_token)
-> ) TYPE=InnoDB;
Query OK, 0 rows affected, 1 warning (0.05 sec)
mysql>
--------------------------------------------
However, other people have reported the same error you saw very recently in other PHP
software that talks to MySQL:
*
http://forums.cacti.net/about17670.html
*
http://www.zen-cart.com/forum/archive/index.php/t-50340.html
Both of the above were running on Windows, which may or may not be coincidental.
From the above forums, my best guess is either a strict
mode problem, or a problem in the definition.
I tried enabling strict mode on my MySQL Linux install and restarting and retesting the
table creation, but I couldn't get it to
give the error you saw; however, try this first: edit your my.cnf file and see if you can
see a sql-mode line like this:
sql-mode="ANSI,TRADITIONAL"
... or something like this ...
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES"
If it's there, try commenting out that line (with a "#" character),
restarting MySQL (or rebooting), and retrying the install.
Now, if that doesn't work, you can either try:
* Select "Experimental MySQL 4.1/5.0 UTF-8" option in the "MySQL specific
options:" section on the config page, and redo the setup.
* Make a backup copy of the "maintenance/tables.sql" file, then try editing the
"maintenance/tables.sql" file, and anytime it says
"NAME-OF-FIELD tinyblob NOT NULL default ''," (where
"NAME-OF-FIELD" will be many things, starting with "user_password"),
delete the
"default ''" bit, and then save the file and retry. You will probably
also need to make the same change for the "NAME-OF-FIELD blob
NOT NULL default ''," lines too.
... And then please let us know how you go (e.g. what does and does not work).
All the best,
Nick.