LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Importing FreeBSD mysql database to RedHat Linux 7.3 (https://www.linuxquestions.org/questions/linux-software-2/importing-freebsd-mysql-database-to-redhat-linux-7-3-a-57794/)

RKris 05-02-2003 05:13 AM

Importing FreeBSD mysql database to RedHat Linux 7.3
 
Hi,
I have one server running on FreeBSD with MYSQL and a RedHat Linux 7.3 server.

I have to import the mysql database from FreeBSD to Linux server. I don;t know how to do that?

I know that mysql databases in RedHat 7.3 are in /var/lib/mysql and on freeBSD looks like in

/usr/local/mysql/var

These databases are directories in the path I said above. If I copy the Database directory from BSD to Linux will it work??

Can anyone help me out?

regards
Krishna

jharris 05-02-2003 05:23 AM

I believe you should be able to create a database with the same name, then copy the files from var/dbName on the old server to the same location on the new server. Failing this use mysqldump to dump the entire db to a file, then use mysql -p someDb < dumpfile.sql to enter all the values again.

HTH

Jamie...

RKris 05-02-2003 05:59 AM

Hey, can you explain that to me clearly?

regards
krishna

jharris 05-02-2003 06:08 AM

Quote:

Originally posted by RKris
Hey, can you explain that to me clearly?
I assume you're talking about the mysqldump yeah? You can dump all your databases (this will include the mysql db) out to a text file using
Code:

mysqldump -u root -p -a -e > dbContents.sql
The dbContents.sql file will contain every create and insert statement necessary to rebuild the db from scratch. You then go to your new db server and run
Code:

mysql -u root -p < dbContents.sql
to import all the data. You'll need to restart the server after the import, or run "flush privileges" so the privileges take ffect.

cheers

Jamie...

RKris 05-02-2003 06:19 AM

Thanks Jamie

Will try this out!!

regards
Krishna

RKris 05-05-2003 06:44 AM

HI,
Doesn't work on freebsd!!

regards
Krishna

jharris 05-06-2003 04:07 AM

You don't have mysqldump? It should be there somewhere, are you sure its just not in your path? Or did something else fail?

cheers

Jamie...


All times are GMT -5. The time now is 10:38 AM.