John Hebert <[EMAIL PROTECTED]> writes: To import do "mysql < dump.sql"
make sure to read dump.sql first (since it's just ascii) and make sure the database is created within the dump file. If not, do a "mysqladmin create dbname" prior to importing the dumpfile. You can also tar up the /var/lib/mysql directory and (assuming you have the right accounts in /etc/passswd) untar it in the appropriate place on your new server. Something like this -- assumes mysql is installed on server1 and new server2, mysql users therfore exist and mysql server revisions are similar and table types needed are built into server (eg. MyISAM) : server1# /etc/init.d/mysql stop server1# cd /var/lib/mysql server1# tar cvzf sqlfiles.tar.gz . server2# scp sqlfiles.tar.gz server:/var/lib/mysql server1# ssh server2 server2# cd /var/lib/mysql server2# tar xvzf sqlfiles.tar.gz server2# /etc/init.d/mysql start (yes I can use pipes to send the tar archive directly via ssh but I'm being verbose intentionally) mysql server documentation talks about this procedure in relation to doing server replication so you may want to review that. You should also investiage phpmyadmin on freshmeat.net for a really nice management app. > Cool. That's what I figured, so thanks for the > confirmation. However, what about the mysql system > database? I'd like to keep the same users/permissions. > Know of a safe and sure way to move it? > > Thanks, > John Hebert > > --- Jason DeWitt <[EMAIL PROTECTED]> wrote: >> I would just grab a dump file of the mysql database >> and then move it to >> the new server and import it. >> >> "mysqldump mysql > mysql.sql" >> >> I believe that will move it all. >> >> John Hebert wrote: >> >> >What would be the quickest way to move some MySQL >> >databases from one Debian box to another upgraded >> >Debian box? I'd like to keep the same >> >users/permissions, so I'll need to move the mysql >> DB >> >as well. >> > >> >I've read through the instructions at: >> >http://www.mysql.com/doc/en/Upgrading-to-arch.html >> > >> >but I don't quite understand this section: >> >---------- >> >Also, don't forget to copy the mysql database >> because >> >that's where the grant tables (user, db, host) are >> >stored. You may have to run commands as the MySQL >> root >> >user on the new machine until you have the mysql >> >database in place. >> > >> >After you import the mysql database on the new >> >machine, execute mysqladmin flush-privileges so >> that >> >the server reloads the grant table information. >> >---------- >> > >> >Do they actually mean a FS copy? If so, I assume >> the >> >mysqld should be stopped, do the copy, and then >> >restart mysqld and then do the 'mysqladmin >> >flush-privileges'? Or, should the mysqld just be >> >running through the FS copy? >> > >> >Thanks, >> >John Hebert >> > >> > >> >__________________________________ >> >Do you Yahoo!? >> >Yahoo! Finance Tax Center - File online. File on >> time. >> >http://taxes.yahoo.com/filing.html >> > >> >_______________________________________________ >> >General mailing list >> >[email protected] >> >http://brlug.net/mailman/listinfo/general_brlug.net >> > >> > >> > >> >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://brlug.net/mailman/listinfo/general_brlug.net > > > __________________________________ > Do you Yahoo!? > Yahoo! Finance Tax Center - File online. File on time. > http://taxes.yahoo.com/filing.html > > _______________________________________________ > General mailing list > [email protected] > http://brlug.net/mailman/listinfo/general_brlug.net > -- Scott Harney<[EMAIL PROTECTED]> "Asking the wrong questions is the leading cause of wrong answers" gpg key fingerprint=7125 0BD3 8EC4 08D7 321D CEE9 F024 7DA6 0BC7 94E5
