Solved

Export and import MySQL with PHPmyAdmin 2.6.2-pl1

Posted on 2007-11-22
9
2,426 Views
Last Modified: 2013-12-13
Hi,

We have MySQL ver. 4.1.12 and uses PHPmyAdmin 2.6.2-pl1and PHP 5.
I need to move the databases from Windows 2000 server to a new server Windows 2003 server with same versions of software mention above.
Im using PHPmySQL to export all databases into one file, copy the file to the new server and using  import, but it fails and displays - Can't find the file.

Obviously I'm doing something wrong, but what?
(Export and import seems logical)
If the solution is to upgrade both servers, Im not keen om doing that. As you probably know Im new at this, and therefor need experts-helping-hand to get this work done :o)
Thank you.

Bjarte
0
Comment
Question by:Bjarte Fjelland
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 17

Expert Comment

by:psimation
ID: 20333548
AFAIK, you don't need to physically copy the exported file to the new destination when trying to import.

Do this:

1. Current location: Use phpmyadmin to export the structure and data in a .zip format - this will prompt a download screen - simply save to Desktop or somewhere.

2. Now, connect to the new location's phpmyadmin, create the new DB, and then go to the import link, then browse to the file you downloaded in step 1 and "upload" - if your mysql and phpmyadmin versions are the same, then this will work flawlessly.
0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 20333783
Yes, the version is equal.
I think Im doing something wrong somewhere.
Getting - No tables found in database.

I have 7 databases + mysql and test.
If I select all databases and use the default settings in export.
Tick the 'Save as file' and use default name.
Click the go button and save the file on my desktop.

On the new server
Im not sure what to call the new database, så I tried the same name that the "old" server had.
Using the SQL icon on the upper left corner, and select import, finding the saved file and pressing go.
Sadly I get the same result - No tables found in database.
Tried to export one database, made a new database with same name as that one I exported, but get the same result.
I understand the message, but not have to solve the issue.
Where do I go wrong? Do you have any other suggestion?
0
 
LVL 20

Expert Comment

by:Muhammad Wasif
ID: 20333798
Open the exported SQL file, remove the comments created by phpMyAdmin and upload/import this. This will work without any problem. First do this with a small database to see if this works for you or not.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 17

Expert Comment

by:psimation
ID: 20334148
Are you sure the user you are logged into phpmyadmin has write/create permissions?
0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 20334285
wasifg : Im getting - File could not be read - When removing the information.

psimation: Im using the root user, the same user that was created under the installation. But do I need the same user and password that the old server uses?
0
 
LVL 20

Accepted Solution

by:
Muhammad Wasif earned 250 total points
ID: 20334350
Which comments you deleted? I am talking about comments like these

-- phpMyAdmin SQL Dump
-- version 2.8.0.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 22, 2007 at 06:45 PM
-- Server version: 4.1.15
-- PHP Version: 4.4.4
--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Table structure for table `add_users`
--

AND

--
-- Dumping data for table `add_users`
--

AND such lines too

-- --------------------------------------------------------
0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 20334452
Yes :o)
0
 
LVL 17

Assisted Solution

by:nplib
nplib earned 250 total points
ID: 20335633
if you are having trouble with the file upload,

you could open the file in a text editor, copy from below the comments to the end, and the paste it in the sql query portion or PHPmyadmin or any query browser and it will work.
0
 
LVL 1

Author Comment

by:Bjarte Fjelland
ID: 20340278
Yes it worked, but I need to take the "import" via the query in small portions.
It is time consuming, but it works.
I tried one of the largest bases, copyed into the query,but my browser stoped responding and the "import" failed :(
I have to thank you all and need to divide the points.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question