简体   繁体   中英

transferring databases from windows phpmyadmin to ubuntu

I shifted from windows to linux(ubuntu) and having trouble to get all the databases which I created in windows in apache server(xampp).I have backup of mysql folder from xampp and inside data folder all the databases are available.But I am getting trouble to import it into my new lampp.What could be the solution.Thanks!

The best way to handle this is to perform an SQL export of the databases on your old system then import those to the new system. Copying the data directory between systems, especially cross platform, is not supported or recommended by MySQL. Exporting the individual database as an SQL file is the best way. You may also desire to export any users associated with that database (not the entire 'mysql' database, though).

If you really don't have access to the old system in any way, you could try to completely replace the new MySQL data directory with the old one. Do not mix and match. Make sure you stop the MySQL service/daemon first before moving any files. Make a backup of the old folder. After you completely replace it, you can start the MySQL service/daemon again and connect to your old databases.

If you need to find where your new data directory is, you can connect to MySQL's command line client and run the STATUS; command, which will list the 'datadir' among other configuration data.

Note that if you wish to save some existing data from your new databases, you'll have to do some more steps to export the old data, stop MySQL, move around the data directory, then restart MySQL and import the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM