Forum Replies Created
-
AuthorPosts
-
ShadowMemberQuote:Duplicate entry '416' for key 1
The answer is in the SQL statement you included in your question: the statement tries to insert the value 416 to the field “id_termo”, but the table already contains a record with the same id_termo. id_termo is the primary key for the table (at least, I guess it is), so it must be unique.
Possible causes:
– you forgot to declare id_termo field as primary key in Access
– the Access db is corrupt (allowed the insertion of the same value more than once) – a slim chance
– you try to import records that already exist in the MySql db, try writing your own import query instead of copying the whole table
ShadowMemberODBC import is the solution (Tools menu). Creating indices (primary key or unique) will prevent you from adding duplicate entries. Besides, you can write your own query which will import those records only that you specify!
ShadowMemberCreate a unique index on the given field. Import will fail if you want to import into an existing table (known flaw in v3.11)! After selecting wich table you want to import click transform, then click Edit SQL. Add a unique index on the given field. Run the import. SQLyog is going to give you a warning each time it encounters a duplicate entry and whether you want to proceed with the import.
ShadowMemberBut send that notice soon, I'll be on holiday from tomorrow!
ShadowMemberYes, SQLyog v3.11 is still available (it is absolutely free). If you can't find it on webyog site then give me a notice and I will send it to you via e-mail.
ShadowMemberSorry, I must have overlooked that one!
ShadowMemberIt's there, but I can't see this option showing up in any menus!
ShadowMemberAre you sure the message reads “Server Version = 9 Client Version = 10” and not vice versa (S. V.=10 C. V.=9)? This means the server and the client use different protocols. Usually it is the client you need to upgrade, but in your case you may have to upgrade MySql to a more recent version, providing you quoted the error message right.
ShadowMemberIt's not the first time when my SQLyog seems to behave differently from others… Pressing N does not cras my SQLyog. In fact, nothing happens. I have to click the “New” button, then the button gets the focus and from then N works as expected. Furthermore, I could not move the focus out of the “Existing indexes” grid by keyboard…
ShadowMemberError 1064 corresponds to syntax error meaning you have a flaw in the most recently executed SQL statement. In this case SQLyog may have generated a “bad” INSER/UPDATE command for some of your tables. What version of SQLyog and MySql do you use? What was the table type?
ShadowMemberWhat if you set the charset of the entire db to latin2? Here is an extract from MySql manual:
Quote:By default, MySQL uses the ISO-8859-1 (Latin1) character set. To change the default set, use the –with-charset option:shell> ./configure –with-charset=CHARSET
CHARSET may be one of big5, cp1251, cp1257, czech, danish, dec8, dos, euc_kr, gb2312, gbk, german1, hebrew, hp8, hungarian, koi8_ru, koi8_ukr, latin1, latin2, sjis, swe7, tis620, ujis, usa7, or win1251ukr. See section 4.6.1 The Character Set Used for Data and Sorting. If you want to convert characters between the server and the client, you should take a look at the SET CHARACTER SET command. See section 5.5.6 SET Syntax. Warning: If you change character sets after having created any tables, you will have to run myisamchk -r -q –set-character-set=charset on every table. Your indexes may be sorted incorrectly otherwise. (This can happen if you install MySQL, create some tables, then reconfigure MySQL to use a different character set and reinstall it.) With the option –with-extra-charsets=LIST you can define which additional character sets should be compiled into the server. Here LIST is either a list of character sets separated with spaces, complex to include all characters that can't be dynamically loaded, or all to include all character sets into the binaries.
ShadowMemberWhat charset does your os use? Because that influences how SQLyog displays the characters!
ShadowMemberBasically it's the same, the only difference is the hostname. If you have a local MySql server then hostname may be either your computer's name/IP address or 'localhost'/127.0.0.1 , while connecting to a remote server you will need the exact hostname or the IP address.
You should also ask whether direct connection is enabled, if not, then you may have to use ssh tunneling.
ShadowMemberYes, that's exactly what I meant!
ShadowMemberDon't forget to ask them whether they allow direct connection to MySql, otherwise you may have to find ways to tunnel SQLyog to MySql!
-
AuthorPosts