MyBB Community Forums

Full Version: SQL error 1062, help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
mySQL error: 1062
Duplicate entry '0' for key 1
Query: INSERT INTO mybb_privatemessages (uid, toid, fromid, folder, subject, icon, message, dateline, status, includesig, smilieoff, receipt, readtime) VALUES ('6', '6', '1', '1', 'Test', '0', 'Test', '1151031629', '0', 'yes', 'no', '0', '0');

Ok, I moved servers, but got SQL error 1104. Hosting company could change it. I'm trying to move back, and I've got everything moved over, but I get this error every time I try to post, PM, etc.

If it helps, I cannot import a sql database from my hosting company's phpmyadmin. I do not have access to cPanel. The way I uploaded it was to create a SQL database (don't get to name it), install fresh copies of MyBB, drop everything from the database, FTP the database to my server, and use SSH through putty to run this command:

mysql -h *hostname* -u *username* -p *databasename* < dumpfile.sql

Anything to get me back up and running would be great!
I apologize but I can't help you, I'm only just moving this thread to the appropriate forum. Smile

Sorry for the inconvenience. Sad
How did you create the tables? With the MyBB installer, manually, from dumpfile.sql, or what? It sounds like there's a problem with the structure, like a missing AUTO_INCREMENT.
I created the tables with the MyBB installer, then dropped them, and inserted from a dump. Did one drop that didn't get inserted back?
Did you check the box to export the auto_increment values when you created the dump (in phpMyAdmin)?
I think so, but I'm going to try creating another dump and inserting it again to make sure.

What about DROP TABLE and IF NOT EXISTS?
You should enable that, too. So the old tables get removed before inserting the data.
ERROR 1064 (00000) at line 20: 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 'DEFAULT CHARSET=latin1' at line 8

What does this mean? I get it when I try to insert it
Ok, I changed the export compatibility to mysql 4, and it worked when I used SSH. It did get rid of the error. However, after I post or make a message, it gives it

showthread.php?tid=0

And says specificed thread does not exist.

The thread shows up on the list, but the link to it goes to ?tid=0

The sequental number is it SUPPOSE to be does not exist either.
Remove all instances of DEFAULT CHARSET=latin1 in the dump.
Is there a command to do this? I'm not extremely familar with adjusting anything inside of phpmyadmin
Pages: 1 2 3