Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-27-2003, 02:39 AM   #1 (permalink)
DarkTwilkitri
Registered User
 
Join Date: Feb 2003
Location: Australia
Posts: 21
DarkTwilkitri is on a distinguished road
Methods of moving a database...

Right, I've got a MySQL database on my local computer.
I want to move it to an online computer.

But, the host has set it up that not only can no-one access the MySQL directories, but also the only one who can even connect to MySQL is the computer itself.

I was thinking that I should write a PHP script to go through the database and generate a script, which recreates the database when ran. NOTE: I AM NOT ASKING FOR HELP WRITING SAID SCRIPT. I know that someone would take me to mean that :/ I've written out database recreation scripts by hand before, I know how to make them.

What I'm asking is, are there any alternate methods of accomplishing this?
DarkTwilkitri is offline   Reply With Quote
Old 10-27-2003, 07:09 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
www.phpmyadmin.net/

if you haven't checked that out, you should. it's php scripts which manage your mysql database.

load it on your local computer, then configure the config file.

you can then backup your table structure + data into a single file.

then, just upload the same scripts to your web host after configuring the config file with the web host info, and you can load up a database with the backup file you made on your local computer.

this is probably the easiest way to accomplish what you are trying to do.

you can backup your mysql database from the command line on your local computer, but you would probably have to use the scripts i mentioned above anyway to get the backup to the web host.

let me know if you have any trouble or questions.
__________________
Mike
sde is offline   Reply With Quote
Old 10-27-2003, 08:20 AM   #3 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
look at the program 'mysqldump'. it should do everything you need.
joe_bruin is offline   Reply With Quote
Old 10-27-2003, 10:36 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
that would only work if he has shell access right?
__________________
Mike
sde is offline   Reply With Quote
Old 10-27-2003, 10:25 PM   #5 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
giving you the ability to execute php scripts but no shell access is like giving you a crowbar but not the keys to the front door.
joe_bruin is offline   Reply With Quote
Old 10-28-2003, 05:33 AM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
Quote:
Originally posted by joe_bruin
giving you the ability to execute php scripts but no shell access is like giving you a crowbar but not the keys to the front door.
nice analogy .. but a lot of web hosts work that way.
__________________
Mike
sde is offline   Reply With Quote
Old 11-18-2003, 08:36 PM   #7 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Quote:
Originally posted by sde
that would only work if he has shell access right?
old thread, but wtf.

He could use mysqldump on his local system, then take the text file and load it into his host through whatever method they've setup. (probably phpmyadmin)
idx is offline   Reply With Quote
Old 11-18-2003, 10:59 PM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
if his host allows mysql traffic from external servers .. i think most hosting companies secure that pretty tight.
__________________
Mike
sde is offline   Reply With Quote
Old 11-19-2003, 05:02 AM   #9 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Quote:
Originally posted by sde
if his host allows mysql traffic from external servers .. i think most hosting companies secure that pretty tight.
That's not what I meant. The hosting co has to have given him some DB admin util. Just use that with the output from his local mysqldump.

-r
idx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
to put data methods inside class or not? sde Java 2 05-25-2004 04:09 PM
Can't see MySql database records in Mozilla monicao PHP 3 05-02-2004 05:19 PM
moving mysql from its default directory infinite_root Linux / BSD / OS X 2 04-28-2004 10:32 PM
Database Users Keen on Linux 2.6 Kernel sde Linux / BSD / OS X 0 05-19-2003 02:01 PM


All times are GMT -8. The time now is 08:49 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting