473,656 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to import a complete db

I have Apachce Mysql PHP on my PC (localhost) at home.
I have a small db with a table or "two".
I want to set up AMP on my PC at work and I want to import
my home db to my work PC (both win32).

Is there a MySQL command that would output/load a db completely
to a file or archive. Then I could ftp or put this object/file on a zip
disk, carry it into work and have it load into the other pc and use it?
Save time vs. recreating the tables passwords from scratch.

A link to a doc. or manual page would be great.

Thanks
Jul 20 '05 #1
6 1813
leegold2 wrote:
I have Apachce Mysql PHP on my PC (localhost) at home.
I have a small db with a table or "two".
I want to set up AMP on my PC at work and I want to import
my home db to my work PC (both win32).

Is there a MySQL command that would output/load a db completely
to a file or archive. Then I could ftp or put this object/file on a zip
disk, carry it into work and have it load into the other pc and use it?
Save time vs. recreating the tables passwords from scratch.


I posted this about 3 days ago:

To dump and load a database use the mysqldump command line utility eg

mysqldump*-u*username*-p*databasename1 *>*filename.tx t

will dump all tables database structure and data into a file containingall
the insert queries. There are additional flags that can speed this up.

mysql*-u*username*-p*databasename2 *<*filename.tx t

will then load this into the other database. After hitting the enter key in
both cases you'll be prompted for your password.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 20 '05 #2
Chris Hope wrote:
....snip..
Save time vs. recreating the tables passwords from scratch.

I posted this about 3 days ago:

To dump and load a database use the mysqldump command line utility eg

mysqldump -u username -p databasename1 > filename.txt

Tried it, I get an error:

mysql> mysqldump -u root -p pips > filename.txt
-> ;
ERROR 1064: 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 'mysqldump -u root -p pips > filename.txt' at line 1
mysql> exit

any help appreciated. Thanks.
Jul 20 '05 #3
leegold2 wrote:
Chris Hope wrote:
...snip..
Save time vs. recreating the tables passwords from scratch.

I posted this about 3 days ago:

To dump and load a database use the mysqldump command line utility eg

mysqldump -u username -p databasename1 > filename.txt

Tried it, I get an error:

mysql> mysqldump -u root -p pips > filename.txt
-> ;
ERROR 1064: 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 'mysqldump -u root -p pips > filename.txt' at line 1
mysql> exit

any help appreciated. Thanks.


Run it from the shell command line, not from within the mysql console.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 20 '05 #4
mysqldump -u username -p databasename1 > filename.txt


Now it prompts you for a password, but if you do:

mysqldump -u username -ppassword databasename1 > filename.txt

It doesn't ask you anything

Note that mysqldump is a standalone program (MYSQLDIR\bin\m ysqldump.exe)
you have to run it from the command prompt, i.e.
c:\mysql\bin> mysqldump -u username -ppassword databasename1 > filename.txt
Jul 20 '05 #5
Another approach is to use phymyadmin. You use the export tab, and
select all the tables and structure and data. Phpmyadmin gives you a
lot of flexibility to choose exactly what you want.

You can even have the output file compressed in pkzip or gzip
automatically, although I have had problems with doing the compression
for large database, but should work fine for small db’s.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/mySQL-import...ict121164.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=404509
Jul 20 '05 #6
steve wrote:
Another approach is to use phymyadmin. You use the export tab, and
select all the tables and structure and data. Phpmyadmin gives you a
lot of flexibility to choose exactly what you want.

You can even have the output file compressed in pkzip or gzip
automatically, although I have had problems with doing the compression
for large database, but should work fine for small db’s.


Thanks I used the cnd line and it worked well.
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1627
by: Kevin MacKenzie | last post by:
I'm a complete newbie to using Python. I have a small question about importing modules. Is there any difference between the two following statements, and what (if any) are they? >>> from Module import * and
2
3049
by: Torsten Mohr | last post by:
Hi, is there some description available to overwrite the import hook? By googling i found out so far that i need to overwrite __builtins__.__import__ with something else. Can i also do this with a C function that is provided when using an embedded python interpreter? So my own C program provides this and when linking with python.lib the function is overwritten?
14
10904
by: Demetris | last post by:
Hello people! I have a table with more than 30 million rows,a lot of columns and indexes. We need to change a column which is dec(15,2) and nullable to have a default value of zero. As I know you cannot alter a column unless it is varchar. I was thinking to export the whole table in ixf format, create the new table with the new definition and then import with insert into. Or rename the original table, create a new one and insert into new...
0
1181
by: Alex | last post by:
Hi, We loading data to db2 udb 7.2 from sql 2000 Using db2 import import 180000 rows with commit every 1000 rows. It takes 7 minutes to complete import Using microsoft DTS and microsoft ole db provider for db2 we call DTS 180 times load 1000 rows each time it takes 1 hr to complete import
1
6475
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access wizard..... If I have to write vb code, where is a sample??? Or do I import the excel in to a new spreadsheet and then write some kind of querey to move the data from that table
2
1947
by: ms | last post by:
In Access 2000, I am using... 'Import Raw text to stageBMIDLog table. DoCmd.TransferText acImportFixed, "BMIDLog Link Specification", "stageBMIDLog", file ....to import raw records into a staging table with 3-key PK. When duplicates are attempting import, I receive a msgbox stating the number of records that violated the PK and asks if I want to continue.
4
6090
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ---------------------------------------------------------------------------------------------------------------------------------------------------------- The @ Import Directive Next to @ Page, the directive that ASP.NET programmers use the most is @ Import. The @ Import directive is ASP.NET's...
2
3490
by: madeleine | last post by:
I'm hoping the answer to this is that I'm just doing something silly, but I'm really scratching my head over this one. I'm importing data from multiple workbooks, each workbook has a sheet called SubSAT and I need to get specific data from that into the database. I'm finding that if I have the workbook open on my desktop then the SubSAT % complete and the High level plan % come in fine, but as soon as the workbook is closed they come...
2
1735
by: Neil99 | last post by:
hi, I'm using the following function to import files form a specified directory. Admittedly I found it elsewhere and amended it but it does seem to work. Is it possible to take it a step further and move the files to another folder after the import is complete? Function Import_Records() 'On Error GoTo Import_Records_Err Dim strInputDir, strImportFile As String, strTableName As String Dim strFileExt As String Dim strSQL As String
6
26304
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this one table. My problem is I have two buttons I want to use this code for for the two buttons would put the data in different tables. I have tried copying and changing a few things and nothing will work for me. The code is set up in a module and then I...
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.