LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-02-2003, 05:13 AM   #1
RKris
Member
 
Registered: May 2002
Location: UK
Distribution: Mandriva linux
Posts: 152

Rep: Reputation: 15
Question 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
 
Old 05-02-2003, 05:23 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
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...
 
Old 05-02-2003, 05:59 AM   #3
RKris
Member
 
Registered: May 2002
Location: UK
Distribution: Mandriva linux
Posts: 152

Original Poster
Rep: Reputation: 15
Hey, can you explain that to me clearly?

regards
krishna
 
Old 05-02-2003, 06:08 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
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...
 
Old 05-02-2003, 06:19 AM   #5
RKris
Member
 
Registered: May 2002
Location: UK
Distribution: Mandriva linux
Posts: 152

Original Poster
Rep: Reputation: 15
Thanks Jamie

Will try this out!!

regards
Krishna
 
Old 05-05-2003, 06:44 AM   #6
RKris
Member
 
Registered: May 2002
Location: UK
Distribution: Mandriva linux
Posts: 152

Original Poster
Rep: Reputation: 15
HI,
Doesn't work on freebsd!!

regards
Krishna
 
Old 05-06-2003, 04:07 AM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem importing database back to MySql shubb Programming 3 11-29-2005 01:36 PM
Problem importing LDIF file into OpenLDAP database cboxall Linux - Newbie 1 06-17-2005 09:51 AM
Problems installing RedHat Database 2.1 on Redhat Linux 9 bkimelman Linux - Software 0 10-18-2003 01:32 PM
MySQL on RedHat 9 GUI, can't access database linuxquestionsu Linux - Software 0 10-09-2003 02:44 PM
MySQL: Importing a database from an XML file concoran General 0 09-08-2003 02:58 AM


All times are GMT -5. The time now is 08:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration