Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use the same MySQL database on Windows (XAMPP) and Linux (LAMP)?

I have dual boot mode with Windows 7 and Ubuntu 10.

On Windows 7 I have XAMPP installed, on Linux I have LAMP installed.
Is it possible to force the MySQL DB servers installed onto different operating systems (even though they would be of identical versions, they are different) to use the same physical files?

So in dual boot mode, independently from the fact that I ran another operating system, I would be able to use the same physical data. Sometimes I'd like to switch OS but it would be great to be able to use the same databases.

like image 262
Jan Avatar asked Jan 09 '11 11:01

Jan


People also ask

Can I have MySQL server and XAMPP server on the same PC?

You can have MySQL server and XAMPP together on the same PC. But the mysql port 3306 will not be availabe to XAMPP MySQL as it would already be taken by the MySQL server. Also if IIS server is already installed, then HTTP port 80 will not be available to XAMPP’s Apache. So, after installing XAMPP, you will see errors in XAMPP like these:

Why can't I start the MySQL service in XAMPP?

If you are not able to start the MySql service in XAMPP, conflicting ports might be the culprit. Some other applications might be using the same, default MySql port (3306) and hence you are not able to start Xampps's MySql service.

How to transfer data from one XAMPP server to another?

You can configure the connection to the Windows XAMPP server and the Linux server, and then Heidi will be able to transfer the data directly from one server to the other. To do that: if you want the data and not just the structure, be sure to select the data dropdown to transfer the data as well.

How to change MySQL port in XAMPP?

You can change the MySql port in the my.ini file, which can be acessed by the Xampp Control Panel, under "config". Thanks for contributing an answer to Stack Overflow!


1 Answers

in your my.ini (in Windows it's located somewhere like C:\Program Files\MySQL\MySQL Server 5.1. It's the main configuration file for MySQL) file, you should have this line:

datadir="C:/ProgramData/MySQL/MySQL Server 5.1/Data/" for example

change it in both Windows and Linux Ubuntu to point to one single physical folder (on a partition with a file system which Windows could recognize). It will work. File formats are identical.

Whether you boot from Ubuntu, or Windows 7, it won't matter, 2 different builds of MySQL will be looking for data in the same place. Once data is modified in Windows environment, you boot up from Ubuntu and the data is there, modified.

like image 175
Alex Avatar answered Sep 21 '22 04:09

Alex