simple mysql table creation in PhpMyAdmin
The database is already made..along with username and password.
But i'm having an issue importing a very simple mysql table.. I usually never use PhpMyAdmin, but I am for this table...just to get this table started / imported. Usually the software programs install these automatically, but not this one. The table is called 'feeds' I'm getting the following error : Quote:
when importing the following feeds.sql file via PhpMyAdmin Code:
CREATE TABLE IF NOT EXISTS `feeds` ( I'm surprised such a small, basic table would return such an error. Any help in modifying the above sql file, to get it right...so it doesn't cause an error. or manually creating the table from scratch is appreciated. I attempted to manually create the table, (without importing the above) but there are fields there, that don't display in the above coding. If ya think that route is easier, all the fields are here : http://imagizer.imageshack.us/v2/800...0/841/eytv.jpg whichever way can get the job done = appreciated. The site has nothing on it so far, so we can trial and error. |
It has nothing to do with PHPMyAdmin.
The unique key on link uses a key length of 255 characters plus a datetime, but link is also UTF8, which can require up to four bytes per character - 255 X 4 = 1020 bytes. MyISAM tables have a limit of 1000 bytes for keys... hence the error. UPDATE *** I see that item_date is not a datetime but a varchar(100) and we don't know the default encoding. If it is also UTF8 then your key length is potentially 1020 + 400 = 1420 bytes. |
trying to contact the developer / coder now. He made the project over 6 months ago...and I just finally got around to it now.. so it's possible he might completely ignore me.
any chance we could figure this out without him? or creating the table from scratch, with just the fields provided? |
Quote:
First, guessing that item_date is actually a date, it is ridiculous to store it as a VARCHAR(100). But not knowing how it might be used in the code I would refrain from changing it to a date or datetime - so you might try to reduce it to something like VARCHAR(24) which should accomodate most basic date or datetime equivalent string formats. (If it isn't a date and actually needs 100 characters... revert). Next, reduce the key size for the link component. If you have reduced item_date to 24 characters and assuming it to be UTF8 then 1000 - 24*4 = 906. Since we know link is UTF8, the max key size for that would then be 226, which is still a generous key for assorted web links! All of that is going to take ~4K storage just for that key, plus the actual data, plus everything else in the table. If it is a very large data set or a very busy access site that may not be a good way to store it and access it. On the other hand, if it is not large or busy the key is probably extreme overkill... but then we know nothing about the usage. So, to summarize, consider reducing the size of the item_date attribute, and definitely reduce the length of the link key, so that the total of both times 4 is less than 1000. A final note: Since this is an untested application, be alert for additional problems... |
Thx for assisting to help.
Oh trust me, I wouldn't be surprised at all if there are problems. He was one of the few that actually offered to take on the project. Since it was regarding adding on to 'simple pie'...which is basically a discontinued product. Some of the details of the project before the coder took it on - Quote:
ok...so basically you're saying : Code:
`item_date` varchar(100) NOT NULL, Code:
`item_date` varchar(24) NOT NULL, and Code:
UNIQUE KEY `link` (`link`(255),`item_date`), Code:
UNIQUE KEY `link` (`link`(200),`item_date`), |
Quote:
|
thx bud, that got it working.
|
All times are GMT -5. The time now is 12:59 PM. |