Error 1062, "Duplicate entry 'a@b.com' for key 'Email_UNIQUE'" on EMPTY TABLE
<p>Title says it all.</p>

<p>Empty table with following creation syntax, only table in database. </p>

<pre><code>CREATE TABLE IF NOT EXISTS `ACME`.`Registration` (
  `ConfirmationNumber` INT NOT NULL AUTO_INCREMENT,
  `FirstName` VARCHAR(45) NOT NULL,
  `LastName` VARCHAR(45) NOT NULL,
  `CompanyName` VARCHAR(100) NOT NULL,
  `Title` VARCHAR(60) NOT NULL,
  `Email` VARCHAR(60) NOT NULL,
  `PhoneNumber` VARCHAR(20) NOT NULL,
  `StreetAddress` VARCHAR(100) NOT NULL,
  `City` VARCHAR(30) NOT NULL,
  `Province` VARCHAR(30) NOT NULL,
  `ZipCode` VARCHAR(10) NOT NULL,
  `Country` VARCHAR(40) NOT NULL,
  PRIMARY KEY (`ConfirmationNumber`),
  UNIQUE INDEX `ConfirmationNumber_UNIQUE` (`ConfirmationNumber` ASC),
  UNIQUE INDEX `Email_UNIQUE` (`Email` ASC),
  UNIQUE INDEX `PhoneNumber_UNIQUE` (`PhoneNumber` ASC))
ENGINE = InnoDB
</code></pre>

<p>Any and all inserts get this error. </p>

<pre><code>Error 1062, "Duplicate entry 'a@b.com' for key 'Email_UNIQUE'"
</code></pre>

<p>I have tried inserting with and without 0 for the auto incrementing confirmation number.</p>

<p>I think this <em>might</em> have something to do with my installation of mysql, as the (Mac) system preferences pane shows the server is running fine, but if I try to stop/start from terminal, I get weird errors. Specifically:</p>

<pre><code>$ mysql.server stop
ERROR! MySQL server PID file could not be found!
$ mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/rover-231-4.rovernet.mtu.edu.pid).
</code></pre>

<p>Although, I <em>know</em> that I am connecting to the right server (localhost) and database, since the data <em>DOES GET INSERTED</em> into the registration table.</p>

<p>This is a Python/MySQL/Flask -> HTML/CSS/JS stack, all of which I am new to. Python code to insert is:</p>

<pre><code>    query_string = (
        "INSERT INTO Registration "
        "(FirstName, LastName, CompanyName, Title, Email, PhoneNumber, "
        "StreetAddress, City, Province, ZipCode, Country) "
        "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);")
    cursor.execute(query_string, (first_name, last_name, company, title, email, phone, address, city, state, zipcode, country))
</code></pre>

<p>EDIT: I should also add that until I ran into an installation issue and had to re-install, the exact same code worked perfectly fine.</p>