Forum Moderators: open

Message Too Old, No Replies

Moving servers with mysqldump?

         

matthewamzn

10:17 pm on Jan 21, 2006 (gmt 0)

10+ Year Member



I have a forum site that I am trying to restore on a new server. I did my backup through shell. I logged in as the root user on machine 1, and created a mysqldump:

mysqldump --compatible=mysql40 --opt -Q -u_____ -p_____ > pathto.sql

then I ftp'd the backup to machine 2 in ascii mode. I restored the database.

The only problem is the autoincrement seems to be completely disabled. I keep getting mysql 1062 errors. Here's an example of an error received when trying to post a new thread:

mySQL error: 1062
Duplicate entry '0' for key 1
Query: INSERT INTO forum_threads (fid, subject, icon, uid, username, dateline, lastpost, lastposter, views, replies, visible) VALUES ('2', 'testing ', '0', '1', 'chatzs', '1137735468', '1137735468', 'chats', '0', '0', '1');

txbakers

11:24 pm on Jan 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've done the mySqldump several times and it restored ona different server without a problem.

Not sure why you'd get that error though.

matthewamzn

5:18 pm on Jan 22, 2006 (gmt 0)

10+ Year Member



I'm using mysql 4.1.15 on both servers.

physics

4:21 am on Jan 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why do you need --compatible and -Q?
Did you try it without these, i.e. just
mysqldump --opt -u__ -p__ foo > foo.sql

matthewamzn

5:52 am on Jan 23, 2006 (gmt 0)

10+ Year Member



That worked.

mysqldump --opt -u__ -p__ foo > foo.sql