Ankündigung

Einklappen
Keine Ankündigung bisher.

Problem mit mySQL

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Problem mit mySQL

    hallo,

    ich habe ein Problem: Immer wenn ich einen DB Befehl ausführen will krieg ich einen error!
    Hier der Code:
    Code:
    #
    # Tabellenstruktur für Tabelle `abook_entrys`
    #
    
    CREATE TABLE abook_entrys (
      id mediumint(8) unsigned NOT NULL auto_increment,
      user smallint(5) unsigned NOT NULL default '0',
      remote_user smallint(5) unsigned NOT NULL default '0',
      group enum('1','2','3','4') NOT NULL default '1',
      PRIMARY KEY  (id),
      KEY user (user)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `attacks`
    #
    
    CREATE TABLE attacks (
      id bigint(20) NOT NULL auto_increment,
      from_pc smallint(6) default '0',
      from_usr smallint(6) default '0',
      from_cluster int(11) default '0',
      to_pc smallint(6) default '0',
      to_usr smallint(6) default '0',
      to_cluster int(11) default '0',
      type enum('block','hijack','scan','smash','trojan') NOT NULL default 'block',
      option enum('cpu','deactivate','defacement','firewall','sdk','transfer') NOT NULL default 'cpu',
      success tinyint(1) default '0',
      noticed tinyint(1) default '0',
      time int(11) NOT NULL default '0',
      payload varchar(255) NOT NULL default '',
      PRIMARY KEY  (id),
      KEY from_cluster (from_cluster),
      KEY to_cluster (to_cluster),
      KEY success (success)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `cboards`
    #
    
    CREATE TABLE cboards (
      cluster smallint(6) default NULL,
      thread int(9) NOT NULL auto_increment,
      relative int(9) default NULL,
      user smallint(6) default NULL,
      user_name tinytext,
      user_cstat smallint(6) default NULL,
      time varchar(10) default NULL,
      subject tinytext,
      content text,
      box tinyint(4) default NULL,
      PRIMARY KEY  (thread),
      KEY cluster (cluster),
      KEY thread (thread),
      KEY relative (relative),
      KEY box (box)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `cl_pacts`
    #
    
    CREATE TABLE cl_pacts (
      cluster smallint(6) default NULL,
      convent tinyint(4) default NULL,
      partner smallint(6) default NULL,
      KEY cluster (cluster),
      KEY partner (partner)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `cl_reqs`
    #
    
    CREATE TABLE cl_reqs (
      user smallint(6) default NULL,
      cluster smallint(6) default NULL,
      comment text,
      dealed char(3) default 'no',
      KEY cluster (cluster),
      KEY dealed (dealed)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `clusterchat`
    #
    
    CREATE TABLE clusterchat (
      chatid int(11) NOT NULL auto_increment,
      clusterid int(11) NOT NULL default '0',
      addedon datetime NOT NULL default '0000-00-00 00:00:00',
      addedby varchar(255) NOT NULL default '0',
      msg varchar(255) NOT NULL default '',
      PRIMARY KEY  (chatid)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `clusters`
    #
    
    CREATE TABLE clusters (
      id int(6) NOT NULL auto_increment,
      name varchar(50) default NULL,
      code varchar(16) default NULL,
      events text,
      tax int(11) NOT NULL default '1',
      money bigint(20) NOT NULL default '0',
      infotext text,
      points int(9) default NULL,
      logofile tinytext,
      homepage tinytext,
      box1 varchar(50) default 'Wichtig',
      box2 varchar(50) default 'Allgemein',
      box3 varchar(50) default 'Alte Beiträge',
      acceptnew char(3) default 'yes',
      rank smallint(6) default '0',
      notice text,
      srate_total_cnt int(11) NOT NULL default '0',
      srate_success_cnt int(11) default '0',
      srate_noticed_cnt int(11) default '0',
      PRIMARY KEY  (id),
      KEY code (code)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `da_participants`
    #
    
    CREATE TABLE da_participants (
      relative int(11) NOT NULL default '0',
      pc smallint(6) NOT NULL default '0',
      ip varchar(7) NOT NULL default '',
      owner smallint(6) NOT NULL default '0',
      owner_name varchar(40) NOT NULL default '',
      KEY relative (relative)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `distr_attacks`
    #
    
    CREATE TABLE distr_attacks (
      id smallint(6) NOT NULL auto_increment,
      cluster smallint(6) default NULL,
      initiator_pc smallint(6) default NULL,
      initiator_usr smallint(6) default NULL,
      target smallint(6) default NULL,
      item enum('av','cpu','fw') NOT NULL default 'av',
      PRIMARY KEY  (id),
      KEY cluster (cluster)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `logins`
    #
    
    CREATE TABLE logins (
      id bigint(20) NOT NULL auto_increment,
      ip varchar(64) NOT NULL default '',
      usr_id smallint(6) NOT NULL default '0',
      time int(11) NOT NULL default '0',
      user_agent varchar(255) NOT NULL default '',
      allowed set('yes','no') NOT NULL default 'no',
      PRIMARY KEY  (id),
      KEY usr_id (usr_id),
      KEY ip (ip)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `logs`
    #
    
    CREATE TABLE logs (
      id bigint(20) NOT NULL auto_increment,
      type enum('other','worm_clmoney','worm_blockpc','worm_pcsendmoney','delcluster','deluser','lockuser','badlogin','chclinfo','qubug','adminedit') NOT NULL default 'other',
      usr_id smallint(6) NOT NULL default '0',
      payload tinytext NOT NULL,
      PRIMARY KEY  (id),
      KEY usr_id (usr_id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `mails`
    #
    
    CREATE TABLE mails (
      mail bigint(20) NOT NULL auto_increment,
      user smallint(6) default NULL,
      user2 smallint(6) default NULL,
      user2_name tinytext NOT NULL,
      time varchar(10) default NULL,
      subject tinytext,
      text text,
      box char(3) default NULL,
      xread char(3) default NULL,
      PRIMARY KEY  (mail),
      KEY user (user)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `news`
    #
    
    CREATE TABLE news (
      id int(11) NOT NULL auto_increment,
      betreff varchar(255) NOT NULL default '',
      text mediumtext NOT NULL,
      time varchar(255) NOT NULL default '',
      author varchar(255) NOT NULL default '',
      kategorie int(1) NOT NULL default '0',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `pcs`
    #
    
    CREATE TABLE pcs (
      id smallint(6) NOT NULL auto_increment,
      name tinytext,
      ip varchar(7) default NULL,
      owner smallint(6) default NULL,
      owner_name tinytext,
      owner_points int(11) default NULL,
      owner_cluster smallint(6) default NULL,
      owner_cluster_code tinytext,
      cpu varchar(4) NOT NULL default '',
      ram tinyint(4) default NULL,
      lan varchar(4) default NULL,
      mm varchar(4) default NULL,
      bb varchar(4) default NULL,
      ads char(1) default NULL,
      dialer char(1) default NULL,
      auctions char(1) default NULL,
      bankhack char(1) default NULL,
      fw varchar(4) default NULL,
      mk varchar(4) default NULL,
      av varchar(4) default NULL,
      ids varchar(4) default NULL,
      ips varchar(4) default NULL,
      rh varchar(4) default NULL,
      sdk varchar(4) default NULL,
      trojan varchar(4) default NULL,
      credits int(11) default NULL,
      lmupd varchar(10) default NULL,
      country enum('afghanistan','antarktis','antigua','argentinien','australien','austria','brasilien','china','deutschland','egypt','england','finnland','frankreich','griechenland','groenland','indien','irak','iran','irland','island','italien','japan','kanada','kuba','lybien','madagaskar','mexico','monaco','namibia','neuseeland','nordkorea','pakistan','peru','portugal','quatar','russland','saudi-arabien','schweden','schweiz','sierraleone','spanien','suedafrika','thailand','tuerkei','usa','vanuatu','vietnam','marlboro','atlantis','myth') NOT NULL default 'myth',
      points mediumint(8) unsigned default NULL,
      la varchar(10) default NULL,
      buildstat tinytext,
      di varchar(10) default NULL,
      dt varchar(10) default NULL,
      lrh varchar(10) default NULL,
      blocked varchar(10) default NULL,
      upgrcode varchar(32) NOT NULL default '',
      os varchar(250) NOT NULL default '',
      nsc int(20) NOT NULL default '0',
      tower tinyint(11) NOT NULL default '0',
      light tinyint(11) NOT NULL default '1',
      netz tinyint(11) NOT NULL default '1',
      luft tinyint(11) NOT NULL default '1',
      PRIMARY KEY  (id),
      KEY ip (ip),
      KEY owner (owner)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `rank_clusters`
    #
    
    CREATE TABLE rank_clusters (
      platz smallint(6) NOT NULL auto_increment,
      cluster smallint(6) default '0',
      members tinyint(4) default '0',
      points int(11) default '0',
      av_points float default '0',
      pcs mediumint(9) default '0',
      av_pcs float default '0',
      success_rate float default '0',
      PRIMARY KEY  (platz)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `rank_users`
    #
    
    CREATE TABLE rank_users (
      platz smallint(6) NOT NULL auto_increment,
      id smallint(6) default NULL,
      name varchar(50) default NULL,
      points int(11) default '0',
      cluster smallint(6) default NULL,
      PRIMARY KEY  (platz)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `sysmsgs`
    #
    
    CREATE TABLE sysmsgs (
      msg int(11) NOT NULL auto_increment,
      user smallint(6) default NULL,
      time varchar(10) default NULL,
      text text,
      xread char(3) default NULL,
      PRIMARY KEY  (msg),
      KEY user (user)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `transfers`
    #
    
    CREATE TABLE transfers (
      from_id smallint(6) default '0',
      from_type enum('cluster','user') NOT NULL default 'cluster',
      from_usr smallint(6) default NULL,
      to_id smallint(6) default '0',
      to_type enum('cluster','user') NOT NULL default 'cluster',
      to_usr smallint(6) default NULL,
      credits bigint(11) default '0',
      time varchar(10) default NULL
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `upgrades`
    #
    
    CREATE TABLE upgrades (
      id bigint(20) NOT NULL auto_increment,
      pc smallint(6) NOT NULL default '0',
      start int(11) NOT NULL default '0',
      end int(11) NOT NULL default '0',
      item varchar(10) NOT NULL default '',
      uniqueid varchar(32) NOT NULL default '',
      PRIMARY KEY  (id),
      UNIQUE KEY uniqueid (uniqueid),
      KEY pc (pc)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `users`
    #
    
    CREATE TABLE users (
      id smallint(6) NOT NULL auto_increment,
      name varchar(40) default NULL,
      email varchar(50) default NULL,
      icq varchar(10),
      password tinytext,
      pcs text,
      gender enum('m','w','x') NOT NULL default 'x',
      birthday varchar(10) default '0.0.0',
      stat smallint(6) default '1',
      liu varchar(10) default NULL,
      lic varchar(10) default NULL,
      clusterstat smallint(6) default NULL,
      homepage tinytext,
      infotext text,
      wohnort tinytext,
      la varchar(10) default NULL,
      ads enum('no','yes') NOT NULL default 'yes',
      bigacc enum('no','yes') NOT NULL default 'no',
      usessl enum('no','yes') NOT NULL default 'no',
      enable_usrimg enum('yes','no') NOT NULL default 'no',
      usrimg_fmt enum('points','ranking','points ranking','cluster points','cluster ranking','cluster points ranking') NOT NULL default 'cluster points ranking',
      noipcheck enum('no','yes') NOT NULL default 'no',
      newmail tinyint(4) default '0',
      lastmail varchar(10) default NULL,
      points int(11) default '0',
      sig_mails tinytext,
      sig_board tinytext,
      cluster int(6) default NULL,
      cm varchar(6) default NULL,
      login_time int(11) NOT NULL default '0',
      sid varchar(32) default NULL,
      sid_ip varchar(128) default NULL,
      sid_pc smallint(6) NOT NULL default '0',
      sid_lastcall int(10) NOT NULL default '0',
      locked enum('no','yes') NOT NULL default 'no',
      locked_till int(11) NOT NULL default '0',
      locked_by varchar(255) NOT NULL default '',
      locked_reason varchar(255) NOT NULL default '',
      stylesheet enum('anti-ie','crystal','standard','konsole','modern','modern-ie','unitedhacker2') NOT NULL default 'unitedhacker2',
      inbox_full tinytext,
      avatar tinytext,
      rank smallint(6) default '0',
      da_avail enum('no','yes') NOT NULL default 'no',
      acode varchar(16) default NULL,
      tcode varchar(16) default NULL,
      pcview_ext enum('yes','no') NOT NULL default 'yes',
      pcview_sorttype enum('','name ASC','points ASC','country ASC','lrh ASC') NOT NULL default '',
      calcrank enum('yes','no') NOT NULL default 'yes',
      last_verified int(11) NOT NULL default '0',
      verifyimg smallint(6) NOT NULL default '0',
      extacc_id varchar(255) NOT NULL default '',
      notiz text,
      ansehen int(11) NOT NULL default '0',
      erfahrung tinyint(11) NOT NULL default '0',
      doubleip set('yes','no') NOT NULL default 'no',
      PRIMARY KEY  (id),
      UNIQUE KEY name_2 (name),
      KEY name (name),
      KEY sid (sid)
    ) TYPE=MyISAM;
    # --------------------------------------------------------
    
    #
    # Tabellenstruktur für Tabelle `verifyimgs`
    #
    
    CREATE TABLE verifyimgs (
      id smallint(6) NOT NULL default '0',
      chars char(3) NOT NULL default '',
      KEY id (id)
    ) TYPE=MyISAM;
    Wäre super wenn mir jemand helfen könnte!

    Illuminati


  • #2
    Fehlermeldung?
    Das sind mehrere sql-Anweisungen, nicht nur eine.
    Wie/Womit werden die ausgeführt?

    Kommentar


    • #3
      Ich führ die üner PHPmyAdmin aus und da kommt folgende Fehlermeldung:

      Fehler

      SQL-Befehl :

      CREATE TABLE abook_entrys(

      id mediumint( 8 ) unsigned NOT NULL AUTO_INCREMENT ,
      user smallint( 5 ) unsigned NOT NULL default '0',
      remote_user smallint( 5 ) unsigned NOT NULL default '0',
      GROUP enum( '1', '2', '3', '4' ) NOT NULL default '1',
      PRIMARY KEY ( id ) ,
      KEY user( user )
      ) TYPE = MYISAM

      MySQL meldet:


      #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 'group enum('1','2','3','4') NOT NULL default '1',
      PRIMARY KE

      Kommentar


      • #4
        Beachte folgendes:
        http://dev.mysql.com/doc/mysql/en/reserved-words.html

        >>> reserved words <<< bei Spaltennamen (zB: `group`) !!!

        Kommentar


        • #5
          daran kann es aber irgendwie nicht liegen, da es sonst immer geklappt hat!

          Kommentar


          • #6
            jede Wette,
            daß es an 'reserved words' liegt!!!

            ~dilemma~

            Kommentar


            • #7
              ok, ich versteh das aber nicht so ganz^^

              Kommentar


              • #8
                Reservierte Worte dürfen nur unter ganz bestimmten Umständen an variablen Stellen (zum dem Namen eines Feldes bei CREATE TABEL) benutzt werden. backticks helfen in aller Regel.
                `GROUP` enum( '1', '2', '3', '4' ) NOT NULL default '1',

                Kommentar

                Lädt...
                X