Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-15-2006, 05:13 PM
|
#1
|
Member
Registered: Oct 2005
Distribution: Slackware
Posts: 228
Rep:
|
How to import a mysql database from backup
I'm trying to import a mysql database backup into a new computer.
I used webmin's mysql module to create the backup file. The name of the database I backed up was 'rt3'. The name of my backup file is 'rt3.sql'. I've already moved it over to the new machine.
I searched the mysql documentation and tried doing:
Code:
mysqlimport rt3 rt3.sql
It thinks I'm trying to import the entire file into a table called rt3, and quits with an error.
The problem is that this is a backup of an entire dB, not just a single table.
I'm no mysql expert, so any suggestions would be appreciated.
Last edited by WindowBreaker; 03-15-2006 at 05:14 PM.
|
|
|
03-15-2006, 05:18 PM
|
#2
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Code:
mysql -p -D rt3 < rt3.sql
|
|
|
03-15-2006, 08:32 PM
|
#3
|
Member
Registered: Oct 2005
Distribution: Slackware
Posts: 228
Original Poster
Rep:
|
I tried that - here's the output:
Code:
mysql -p -D rt3 < rt3.sql
Quote:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rt3.sql
(44,'Group',23,'WatchAsAdminCc','RT::System',1,0,0),(47,'Group',4,'Admin' at line 1
|
The backup is coming from a mysql v 4.1.16 (which I manually compiled), and the new system is using mysql v4.1.14 (ships with slack 10.2).
I'm assuming the version mismatch is causing the problem.
Is there any way around this - such as a platform/version independent backup process, after which I can import the entire dB into the new system?
Last edited by WindowBreaker; 03-15-2006 at 08:34 PM.
|
|
|
03-15-2006, 11:55 PM
|
#4
|
Senior Member
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,868
|
|
|
|
03-16-2006, 12:01 PM
|
#5
|
Member
Registered: Oct 2005
Distribution: Slackware
Posts: 228
Original Poster
Rep:
|
thanks for the suggestion willysr. However, I already tried it with phpmyadmin, and the following error below is given (pretty long):
Quote:
Error
There is a chance that you may have found a bug ...[cut]
-- Host: localhost Database: rt3
-- ------------------------------------------------------
-- Server version 4.1.16-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
----END RAW----
SQL query:
rt3.sql0000644
MySQL dump 10.9 -- -- Host: localhost Database: rt3 -- ------------------------------------------------------ -- Server version 4.1.16-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
MySQL said:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rt3.sql' at line 1
|
Last edited by WindowBreaker; 03-16-2006 at 12:06 PM.
|
|
|
03-16-2006, 06:59 PM
|
#6
|
Senior Member
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,868
|
it seems that your query was not accepted by 4.1.14
maybe you can post your query file?
|
|
|
03-16-2006, 11:08 PM
|
#7
|
Member
Registered: Oct 2005
Distribution: Slackware
Posts: 228
Original Poster
Rep:
|
*Resolved
The problem was being caused by non-identical files. I ran an md5sum on both the original and copy, and they didn't match (even though their sizes did).
[shame on me - rookie mistake]
Then I ended up using phpmyadmin to import the file into the dB without a hitch.
Thanks to everyone for your suggestions.
|
|
|
All times are GMT -5. The time now is 12:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|