Sql Prob.

Having problems installing EM? Let's fix that
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
grate1n8
Registered User
Posts: 2
Joined: Sun Nov 05, 2006 5:49 pm

Sql Prob.

Post by grate1n8 »

When i Try installing EasyMOD It can't Install any of the sql i just get this

Code: Select all

Error :: Invalid default value for 'mod_id'
SQL   :: CREATE TABLE phpbb_easymod ( mod_id mediumint(8) NOT NULL DEFAULT '0' auto_increment, mod_title varchar(50) NULL DEFAULT '', mod_file varchar(255) NULL DEFAULT '', mod_version varchar(15) NULL DEFAULT '', mod_author_handle varchar(25) NULL DEFAULT '', mod_author_email varchar(100) NULL DEFAULT '', mod_author_name varchar(100) NULL DEFAULT '', mod_author_url varchar(100) NULL DEFAULT '', mod_description text NULL DEFAULT '', mod_process_date int(11) NULL DEFAULT '0', mod_phpBB_version varchar(15) NULL DEFAULT '', mod_processed_themes varchar(200) NULL DEFAULT '', mod_processed_langs varchar(200) NULL DEFAULT '', mod_files_edited mediumint(8) NULL DEFAULT '0', mod_tables_added mediumint(8) NULL DEFAULT '0', mod_tables_altered mediumint(8) NULL DEFAULT '0', mod_rows_inserted mediumint(8) NULL DEFAULT '0', PRIMARY KEY (mod_id))
Can Someone help Thx.

Nightrider
Registered User
Posts: 7219
Joined: Tue Nov 16, 2004 8:54 pm
Location: Florida, US
Contact:

Re: Sql Prob.

Post by Nightrider »

Make sure that the username assigned to your database has full privileges. You can check the settings in your Host CPanel, probably in the MySql utility...

Changing Database Username Privileges

I have seen several different flavors of this in MySql, so what you see may be slightly different from what I'm posting below. It should give you a good idea of where to look and what to do though...

Next to the database in MySql, you should see something like this icon. Click on it:

Image

That should take you to your MySQL database management page. At the bottom, you should see a section named Database users. Click on this icon:

Image

That should bring you to the Edit privileges page that may or may not look something like this. I have seen several different versions on this page but you should be able to figure out what to change:

Image

After pressing the Submit button, you should be able to finish the EM install..

Image

cknight725
Registered User
Posts: 1
Joined: Wed Nov 08, 2006 8:13 am

Re: Sql Prob.

Post by cknight725 »

Ran into same problem -- apparently there is a new rule that applies to text/blob columns in MySql 5.0.27 - these columns cannot have default values (I guess?). I'm running MySQL for Windows 5.0.27 .

I was able to fix this by modifying the CREATE TABLE statement (line 906) in \mods\easymod\easymod_install.php. To get it to run remove the " DEFAULT '' " from the mod_description column definition.

Code: Select all

$sql[] = "CREATE TABLE " . EASYMOD_TABLE . " (
	mod_id mediumint(8) NOT NULL auto_increment,
	mod_title varchar(255) NULL DEFAULT '',
	mod_file varchar(255) NULL DEFAULT '',
	mod_version varchar(15) NULL DEFAULT '',
	mod_author_handle varchar(25) NULL DEFAULT '',
	mod_author_email varchar(100) NULL DEFAULT '',
	mod_author_name varchar(100) NULL DEFAULT '',
	mod_author_url varchar(100) NULL DEFAULT '',
	mod_description text NULL,
	mod_process_date int(11) NULL DEFAULT '0',
	mod_phpBB_version varchar(15) NULL DEFAULT '',
	mod_processed_themes varchar(200) NULL DEFAULT '',
	mod_processed_langs varchar(200) NULL DEFAULT '',
	mod_files_edited mediumint(8) NULL DEFAULT '0',
	mod_tables_added mediumint(8) NULL DEFAULT '0',
	mod_tables_altered mediumint(8) NULL DEFAULT '0',
	mod_rows_inserted mediumint(8) NULL DEFAULT '0',
	PRIMARY KEY (mod_id))";
I'm no expert, but I think this would be a stable change for all previous versions of MySQL as well ...

Nightrider
Registered User
Posts: 7219
Joined: Tue Nov 16, 2004 8:54 pm
Location: Florida, US
Contact:

Re: Sql Prob.

Post by Nightrider »

cknight725 wrote: Ran into same problem -- apparently there is a new rule that applies to text/blob columns in MySql 5.0.27 - these columns cannot have default values (I guess?). I'm running MySQL for Windows 5.0.27 .

I was able to fix this by modifying the CREATE TABLE statement (line 906) in \mods\easymod\easymod_install.php. To get it to run remove the " DEFAULT '' " from the mod_description column definition.

That sounds interesting, but it really doesn't make any sense to me. First, if MySql stopped allowing default values for text/blob fields, everyone would quit using it. Default values are necessary for any serious database, even for text/blob fields...

Second, the problem reported above was with the mod_id, not the mod_description. Even if you remove the default setting for the mod_description field, you still have the mod_id problem....

Image

Locked