Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL] Problem z nadaniem indeksów w mysql
dma3
post 31.05.2007, 15:59:39
Post #1





Grupa: Zablokowani
Postów: 14
Pomógł: 0
Dołączył: 29.05.2007

Ostrzeżenie: (0%)
-----


Próbując nałożyć tworzenie indeksów w MySQL
  1. ALTER TABLE 'forum_' ADD INDEX ('id_');



dostaje blad:
Cytat
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''forum_' ADD INDEX (id_)' at line 1


Struktuta tabeli forum_

  1. CREATE TABLE `forum_` (
  2. `id` int(8) NOT NULL AUTO_INCREMENT,
  3. `id_` int(8) NOT NULL DEFAULT '0',
  4. `id_b` int(8) NOT NULL DEFAULT '0',
  5. `status` int(8) NOT NULL DEFAULT '0',
  6. `zablokowany` int(8) NOT NULL DEFAULT '0',
  7. `autor` varchar(255) collate utf8_swedish_ci NOT NULL DEFAULT '',
  8. `temat` text collate utf8_swedish_ci NOT NULL,
  9. `opis` text collate utf8_swedish_ci NOT NULL,
  10. `tresc` text collate utf8_swedish_ci NOT NULL,
  11. `odslony` int(8) NOT NULL DEFAULT '0',
  12. `nowy_temat` int(8) NOT NULL DEFAULT '0',
  13. `ostatni_post` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  14. `ikona` int(255) NOT NULL DEFAULT '0',
  15. `data_dodania` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  16. `data_edycji` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  17. `ip_autora` varchar(30) collate utf8_swedish_ci NOT NULL DEFAULT '',
  18. `html` int(8) NOT NULL DEFAULT '0',
  19. `xcode` int(8) NOT NULL DEFAULT '0',
  20. `emoikony` int(8) NOT NULL DEFAULT '0',
  21. `ip` varchar(50) collate utf8_swedish_ci NOT NULL DEFAULT '',
  22. PRIMARY KEY (`id`)
  23. ) ENGINE=MyISAM AUTO_INCREMENT=20655 DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci AUTO_INCREMENT=20655 ;



co robie zle ?

w bazie juz sa rekordy.


a jak daje

  1. ALTER TABLE `forum_c` ADD INDEX `in` ( `id_` ( 8 ) )


dostaje

Cytat
#1089 - Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
Go to the top of the page
+Quote Post
Darti
post 1.06.2007, 01:09:49
Post #2





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

Ostrzeżenie: (0%)
-----


  1. ALTER TABLE `forum_` ADD INDEX ( `id_` )


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 20.06.2025 - 05:05