Seite 1 von 1

mysql frage

Verfasst: 28.09.2011 05:58
von DaSasha
halloooo :P
hätte mal ne frage bezüglich der datenbank und tabellen

und zwar "Indizes"
Da muss ich Werte eintragen in meiner datei....
die Tabelle sieht so aus

Tabelle: login_attempt

Schlüsselname------Typ------Unique------Gepackt------Spalte------Kardinalität------Kollation
att_ip-------------BTREE-------Nein----------Nein------attempt_ip--------0----------------A
attempt_time----BTREE-------Nein----------Nein------attempt_ip--------0----------------A
att_for------------BTREE-------Nein----------Nein------attempt_forwarded_for-----0-----A
attempt_time----BTREE-------Nein----------Nein------attempt_ip--------0----------------A
att_time----------BTREE-------Nein----------Nein------attempt_time-----0----------------A
user_id------------BTREE-------Nein----------Nein---------user_id---------0----------------A
attempt_ip------FULLTEXT-----Nein---------Nein--------attempt_ip------0


Hier geht es um das FULLTEXT
wie muss ich das einfügen???
Bei BTREE weiss ich das die Zeilen so geschrieben werden:
KEY `user_id` (`user_id`),

aber was muss ich schreiben um FULLTEXT zubekommen?


Danke schonmal
hoffe ihr habt meine erklärung verstanden :grin:

Re: mysql frage

Verfasst: 28.09.2011 12:33
von cYbercOsmOnauT
ALTER TABLE `login_attempt` ADD FULLTEXT (attempt_ip)

Re: mysql frage

Verfasst: 28.09.2011 13:00
von DaSasha

Code: Alles auswählen

"CREATE TABLE `test_login_attempts` (
  `attempt_ip` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_browser` varchar(150) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_forwarded_for` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_time` int(11) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `username` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  `username_clean` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  KEY `att_ip` (`attempt_ip`,`attempt_time`),
  KEY `att_for` (`attempt_forwarded_for`,`attempt_time`),
  KEY `att_time` (`attempt_time`),
  KEY `user_id` (`user_id`),
  ALTER TABLE `login_attempt` ADD FULLTEXT (attempt_ip)
)
Ist es so richtig?

Re: mysql frage

Verfasst: 28.09.2011 21:16
von caymans
Mensch, ist das kompliziert! Sollte mich dran setzen und etwas üben ;-)

Re: mysql frage

Verfasst: 28.09.2011 23:23
von cYbercOsmOnauT
DaSasha hat geschrieben:Ist es so richtig?
Achso.. direkt beim CREATE. Dann so

Code: Alles auswählen

CREATE TABLE `test_login_attempts` (
  `attempt_ip` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_browser` varchar(150) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_forwarded_for` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  `attempt_time` int(11) unsigned NOT NULL DEFAULT '0',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `username` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  `username_clean` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  KEY `att_ip` (`attempt_ip`,`attempt_time`),
  KEY `att_for` (`attempt_forwarded_for`,`attempt_time`),
  KEY `att_time` (`attempt_time`),
  KEY `user_id` (`user_id`),
  FULLTEXT (attempt_ip)
)