LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-17-2006, 07:01 PM   #1
MaaSTaaR
Member
 
Registered: Aug 2005
Location: Kuwait
Distribution: OpenSuSE
Posts: 40

Rep: Reputation: 15
convert MySQL data from Windows to Linux


Hello ...

i want convert MySQL databases , it's on windows and i found it in C:/Apache/mysql/data

my question is where i can found like C:/Apache/mysql/data folder in linux ?
 
Old 01-18-2006, 12:43 PM   #2
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
well, there really is no C:/ in linux. there is the root folder /
and then there are other folders under that.
on debain (what i use at work) the folder that the database tables are stored in is located in /var/lib/mysql
as to how to convert them, it may be easier to export them to an sql.txt or backup.txt or something.sql, include all the insert commands and create commands .
then import them into your linux sql database.
 
Old 01-18-2006, 06:49 PM   #3
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
nephish is right. You can dump an entire database using mysqldump. This command will dump the entire structure and contents of the "databasename" database on the local machine to a file called backup.sql (the -p option will prompt you for your password):
Code:
mysqldump -u mylogin -p databasename > backup.sql
You can also dump the data from a remote server (if you have permission to access it from your host):
Code:
mysqldump -u mylogin -p --quick -h database.server.com databasename > backup.sql
To get the backed up database onto the new machine, first create the database:
Code:
mysqladmin -p create databasename
And then do the magic to bring the structure and data back:
Code:
mysql -u mylogin -p databasename < backup.sql
Hope that helps.


Håkan
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert a qt designer code in linux to run in windows shaj4848 LinuxQuestions.org Member Success Stories 0 07-27-2005 01:29 AM
Burn Data DVD... Read Data in Linux and Windows SaintStrive Linux - Newbie 3 09-18-2004 05:04 PM
MySQL: Convert Windows DB to *nix? carmstrong Linux - Software 1 05-18-2004 01:10 PM
Is there any way to convert windows software to Linux? Fear58 Linux - Software 2 02-24-2004 07:26 PM
Windows User/Linux ubernewb seeking to convert B4UTRUST Linux - Distributions 12 01-23-2004 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration