R4Z0R49 / DayZAdmin

DayZAdmin - forked from katzsmile/DayZAdmin
22 stars 17 forks source link

SQL issue #132

Closed AFakeman closed 11 years ago

AFakeman commented 11 years ago

When using your SQL file, no new tables or anything appears. Error SQL (1062): Duplicate entry 'ATV_CZ_EP1' for key 'PRIMARY'

wriley commented 11 years ago

The sql file is meant to be run on a new, empty database. The error you got should only happen if you ran it on an existing database or you are not using the current version. If that is not the case please provide more details.

Using the current dayz.sql on a new, empty database works for me.

mysql> create database mytest;
Query OK, 1 row affected (0.13 sec)
$ mysql mytest < dayz.sql
AFakeman commented 11 years ago

I am very sorry for being a newb, but how do I create a db with a MySQL Workbench?

wriley commented 11 years ago

I'm not familiar with that product but it looks like there is documentation available. http://dev.mysql.com/doc/workbench/en/wb-getting-started-tutorial.html

AFakeman commented 11 years ago

Now I'm trying to use command line, but how do I specify your sql file directory? P.S. Any good lightweight apache servers?

wriley commented 11 years ago

You can run something like this from the BlissAdming sql directory (cd there first):

mysql -u USERNAME DATABASE -pPASSWORD < dayz.sql

This will work if mysql is in your PATH. If you're on Windows I can't help you, I'm a Linux/Unix guy.

Marcuzz commented 11 years ago

Are you sure the tables don't appear? Are you sure you double clicked your database on the left hand side of MySQL workbench followed by double clicking 'Tables' and right click on the table and press 'Edit table data' that will display all the colums.

If not, try this and tell us if you get any errors(If this works, the tables should be here):

In the query tab you have to type:

DELETE FROM object_classes;

After that you can import the object_classes again by typing this:

CREATE TABLE IF NOT EXISTS `object_classes` (
  `Classname` varchar(128) NOT NULL DEFAULT '',
  `Type` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`Classname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `object_classes` (`Classname`, `Type`) VALUES
    ('ATV_CZ_EP1', 'atv'),
    ('car_hatchback', 'car'),
    ('datsun1_civil_3_open', 'car'),
    ('Fishing_Boat', 'largeboat'),
    ('S1203_TK_CIV_EP1', 'bus'),
    ('Tractor', 'farmvehicle'),
    ('BAF_Offroad_D', 'car'),
    ('UAZ_Unarmed_TK_EP1', 'car'),
    ('UH1H_DZ', 'helicopter'),
    ('UralCivil2', 'truck'),
    ('V3S_Civ', 'truck'),
    ('Volha_1_TK_CIV_EP1', 'car'),
    ('Volha_2_TK_CIV_EP1', 'car'),
    ('Ikarus', 'bus'),
    ('ATV_US_EP1', 'atv'),
    ('BAF_Offroad_W', 'car'),
    ('car_sedan', 'car'),
    ('hilux1_civil_1_open', 'car'),
    ('hilux1_civil_2_covered', 'car'),
    ('hilux1_civil_3_open', 'car'),
    ('Ikarus_TK_CIV_EP1', 'bus'),
    ('LandRover_TK_CIV_EP1', 'car'),
    ('MH6J_EP1', 'helicopter'),
    ('MH6J_DZ', 'helicopter'),
    ('Old_bike_TK_CIV_EP1', 'bike'),
    ('Old_bike_TK_INS_EP1', 'bike'),
    ('PBX', 'smallboat'),
    ('Skoda', 'car'),
    ('SkodaBlue', 'car'),
    ('SkodaGreen', 'car'),
    ('Smallboat_1', 'mediumboat'),
    ('Smallboat_2', 'mediumboat'),
    ('SUV_TK_CIV_EP1', 'car'),
    ('TentStorage', 'tent'),
    ('TT650_Ins', 'motorcycle'),
    ('TT650_TK_CIV_EP1', 'motorcycle'),
    ('TT650_TK_EP1', 'motorcycle'),
    ('UAZ_INS', 'car'),
    ('UAZ_RU', 'car'),
    ('UAZ_Unarmed_TK_CIV_EP1', 'car'),
    ('UAZ_Unarmed_UN_EP1', 'car'),
    ('UralCivil', 'truck'),
    ('Mi17_DZ', 'helicopter'),
    ('AN2_DZ', 'plane'),
    ('Hedgehog_DZ', 'hedgehog'),
    ('Wire_cat1', 'wire'),
    ('Sandbag1_DZ', 'sandbag'),
    ('AH6X_DZ', 'helicopter'),
    ('datsun1_civil_1_open', 'car'),
    ('Lada1_TK_CIV_EP1', 'car'),
    ('M1030', 'motorcycle'),
    ('SUV_TK_EP1', 'car'),
    ('VolhaLimo_TK_CIV_EP1', 'car'),
    ('Lada2', 'car'),
    ('hilux1_civil_3_open_EP1', 'car'),
    ('LandRover_CZ_EP1', 'car'),
    ('C130J','plane'),
    ('datsun1_civil_2_covered','car'),
    ('Fishing_Boat_DZ','largeboat'),
    ('HMMWV_DES_EP1','truck'),
    ('HMMWV_DZ','truck'),
    ('Lada1','car'),
    ('Lada2_TK_CIV_EP1','car'),
    ('LadaLM','car'),
    ('M1030_US_DES_EP1','motorcycle'),
    ('Mi17_Civilian_DZ','helicopter'),
    ('MMT_Civ','bike'),
    ('Old_moto_TK_Civ_EP1','motorcycle'),
    ('PBX_DZ','smallboat'),
    ('Pickup_PK_DZ','car'),
    ('Roket_Maule_M7_STD','plane'),
    ('SkodaRed','car'),
    ('Smallboat_1_DZ','mediumboat'),
    ('Smallboat_2_DZ','mediumboat'),
    ('SUV_Blue','car'),
    ('SUV_Charcoal','car'),
    ('SUV_Green','car'),
    ('SUV_Orange','car'),
    ('SUV_Pink','car'),
    ('SUV_Red','car'),
    ('SUV_Silver','car'),
    ('SUV_Special','car'),
    ('SUV_White','car'),
    ('SUV_Yellow','car'),
    ('TowingTractor','farmvehicle'),
    ('TT650_Civ','motorcycle'),
    ('TT650_Gue','motorcycle'),
    ('UAZ_MG_DZ','car'),
    ('UralRefuel_INS','truck'),
    ('Ural_INS','truck'),
    ('VWGolf','car'),
    ('Zodiac_DZ','smallboat');

I'm sorry for the long code, I find this the easiest way to explain it. Eitherway, If you want to try out another MySQL program you could try out HeidiSQL, it's pretty lightweight and easier to use!

Also, for a local apache server you could use 'WAMP' if you want it online I suggest you to buy a domain and web hosting.

AFakeman commented 11 years ago

Well, everything went well with an empty db.

Marcuzz commented 11 years ago

It would display an error if you had an empty db. Are you sure you are connecting to the database right? Or using MySQL Workbench right?

Try running this query:

SELECT * FROM object_classes WHERE Classname = 'Tractor';

Does it display anything?