473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do I copy a db?

My website uses php/mysql/linux and is hosted by a local web-hosting
company. I access the db via cpanel/phpmyadmin and currently perform
all testing and changes on the live db and website ( not good!).

I would like a copy of the db on my own machine at home so I can test
locally rather than on the live db.
I have successfully installed mysql at home (on windows) and now I'd
like to get a copy of the db and data and would like to put this on my
db at home.

How is this possible?

Thanks in advance.
Manny
Jul 23 '05 #1
6 1687
"Manny" <ma******@hotmail.com> wrote in message
news:3e*************************@posting.google.co m...
My website uses php/mysql/linux and is hosted by a local web-hosting
company. I access the db via cpanel/phpmyadmin and currently perform
all testing and changes on the live db and website ( not good!).

I would like a copy of the db on my own machine at home so I can test
locally rather than on the live db.
I have successfully installed mysql at home (on windows) and now I'd
like to get a copy of the db and data and would like to put this on my
db at home.

How is this possible?


Check out the [mysqldump] utility that comes with your myslql/linux.
This will let you output the sql text that will create the database, all
it's tables and indices, and insert all the data. You will:

1) mysqldump -u{usr} -p{pwd} {dbname} > sql.txt # create the text
dump
2) Move sql.txt to your local (windows) computer
3) mysql -u{usr} -p{pwd} < sql.txt

I don't *think* you need to sweat the Linux/Microsoft <lf>/<cr><lf> line
termination thingy since this should all be just whitespace to MySQL. My
knowledge of the MS side of things is getting shakey. Hopefully, someone
else will jump in if I missed something.

Thomas Bartkus
Jul 23 '05 #2
"Manny" <ma******@hotmail.com> wrote in message
news:3e*************************@posting.google.co m...
My website uses php/mysql/linux and is hosted by a local web-hosting
company. I access the db via cpanel/phpmyadmin and currently perform
all testing and changes on the live db and website ( not good!).

I would like a copy of the db on my own machine at home so I can test
locally rather than on the live db.
I have successfully installed mysql at home (on windows) and now I'd
like to get a copy of the db and data and would like to put this on my
db at home.

How is this possible?


Check out the [mysqldump] utility that comes with your myslql/linux.
This will let you output the sql text that will create the database, all
it's tables and indices, and insert all the data. You will:

1) mysqldump -u{usr} -p{pwd} {dbname} > sql.txt # create the text
dump
2) Move sql.txt to your local (windows) computer
3) mysql -u{usr} -p{pwd} < sql.txt

I don't *think* you need to sweat the Linux/Microsoft <lf>/<cr><lf> line
termination thingy since this should all be just whitespace to MySQL. My
knowledge of the MS side of things is getting shakey. Hopefully, someone
else will jump in if I missed something.

Thomas Bartkus

Jul 23 '05 #3
"Thomas Bartkus" <to*@dtsam.com> wrote in message news:<RI********************@telcove.net>...
I don't *think* you need to sweat the Linux/Microsoft <lf>/<cr><lf> line
termination thingy since this should all be just whitespace to MySQL. My
knowledge of the MS side of things is getting shakey. Hopefully, someone
else will jump in if I missed something.
Thomas Bartkus


Hi,

I do not have access to the linux server therefore cannot perform any
command line queries. Can I create a copy of a DB via phpmyadmin?
Also I would like to backup the db as well - is this possible via
phymyadmin also - or is this something I need to request from my
hoster?

Thanks
Jul 23 '05 #4
"Manny" <ma******@hotmail.com> wrote in message
news:3e**************************@posting.google.c om...
"Thomas Bartkus" <to*@dtsam.com> wrote in message news:<RI********************@telcove.net>...
I do not have access to the linux server therefore cannot perform any
command line queries. Can I create a copy of a DB via phpmyadmin?
I don't know! Someone who knows phpmyadmin will have to chime in.
Also I would like to backup the db as well - is this possible via
phymyadmin also - or is this something I need to request from my
hoster?


Hard to believe your hoster won't provide you with a shell account where you
can do a mysqldump.
Are you working in MS Windows?
If so.
You can link tables to the Linux/MySQL in Access and do
CREATE TABLE {mysql_tbl_backup}
SELECT *
FROM {mysql_linked_table}
This will create a table+data backup on your local windows computer as an
Access .mdb file. Note that this will not copy your indices.

Or you can look for a windows/MySQL client like MySQL-Front which I believe
will allow you to copy mysql tables
http://www.mysql-front.com/
- there are others.

Thomas Bartkus

Jul 23 '05 #5
Hi - are you a programmer ? [I AM]
I Do this kind o stuff all the time for my clients
utilizing VFP and some tools I wrote .
For Example - I have 11 clients that use LunarPages Hosting - and
they have no shell access - so they have to 'do things' with the
myPhpAdmin thingie [usually] and 'insert from file' is not enabled for them
somehow -
so what I did was to write utils in VFP that accesses the mysql db's via
odbc ..
For LunarPages - its a bit weird each time - you have to get the machine
name of the
client workstation and put that in the db access security area .

if you need further assistance - contact me at mysql at efgroup dot net .
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
Mondo Cool TeleCom -> http://www.efgroup.net/efgcog.html
Mondo Cool WebHosting -> http://www.efgroup.net/efglunar.html
Mondo Cool Satellites -> http://www.efgroup.net/sat
VFP Webhosting? You BET! -> http://efgroup.net/vfpwebhosting
mySql / VFP / MS-SQL

"Manny" <ma******@hotmail.com> wrote in message
news:3e*************************@posting.google.co m...
My website uses php/mysql/linux and is hosted by a local web-hosting
company. I access the db via cpanel/phpmyadmin and currently perform
all testing and changes on the live db and website ( not good!).

I would like a copy of the db on my own machine at home so I can test
locally rather than on the live db.
I have successfully installed mysql at home (on windows) and now I'd
like to get a copy of the db and data and would like to put this on my
db at home.

How is this possible?

Thanks in advance.
Manny

Jul 23 '05 #6
ma******@hotmail.com (Manny) wrote in news:3e1d3163.0501240242.2de2c45
@posting.google.com:
My website uses php/mysql/linux and is hosted by a local web-hosting
company. I access the db via cpanel/phpmyadmin and currently perform
all testing and changes on the live db and website ( not good!).

I would like a copy of the db on my own machine at home so I can test
locally rather than on the live db.
I have successfully installed mysql at home (on windows) and now I'd
like to get a copy of the db and data and would like to put this on my
db at home.

How is this possible?

Thanks in advance.
Manny


You "dump" the database to a text file. In the PHPMyAdmin screen, go to
"Export"... select all the tables, check the "complete inserts" box, and
save the file (your browser will prompt you to save the file).... call it
"whatever.sql" or "whatever.txt"

throw it into your "mysql/bin" directory, then go to a command prompt in
that directory, type:

mysql -u USERNAME -p < whatever.sql

you will be prompted for your password, and the database will then be
created.
depending on the dump file, you may have to create your database before
doing the dump.

Jul 23 '05 #7

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

Similar topics

42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
15
by: A | last post by:
Hi, A default copy constructor is created for you when you don't specify one yourself. In such case, the default copy constructor will simply do a bitwise copy for primitives (including...
2
by: Alex | last post by:
Entering the following in the Python shell yields >>> help(dict.copy) Help on method_descriptor: copy(...) D.copy() -> a shallow copy of D >>>
24
by: rdc02271 | last post by:
Hello! Is this too crazy or not? Copy constructor: why can't I copy objects as if they were structs? I have a set of simple objects (no string properties, just integers, doubles) and I have to...
10
by: utab | last post by:
Dear all, So passing and returning a class object is the time when to include the definition of the copy constructor into the class definition. But if we don't call by value or return by value, ...
22
by: clicwar | last post by:
A simple program with operator overloading and copy constructor: #include <iostream> #include <string> using namespace std; class Vector { private: float x,y; public: Vector(float u, float...
3
by: maheshkadam | last post by:
Hi friends I am new to perl so please guide me. I have one application which created backup log file every day.But it appends that file so you can see logs for different day in one file only. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.