PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Import sql datatbase into MySQL on Red Hat v. 4
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Import sql datatbase into MySQL on Red Hat v. 4

Réponse
 
LinkBack Outils de la discussion
Vieux 13/10/2007, 21h13   #1
Sysop1911@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Import sql datatbase into MySQL on Red Hat v. 4

I'm trying to copy a sql database from our client office W2K box
running MySQL to corporate office Red Hat (ver 4) box also running
MySQL, how do I do this?

I have a MySQL database at work, at the client site, running on a
Windows 2000 server box. We have a backup box at our corporate office
that we regularly (in theory) copy the MySQL database to. The backup
box at our corporate office is running on Red Hat version 4. I need
to copy the .sql database from the client site box-Windows 2000 server
to the backup box- Red Hat. I was able to successfully pull the .sql
database from the W2K box using MySQL Administrator. I can't figure
out how to push the .sql database onto the Red Hat box at our
corporate office. I am new to this job and the previous guy didn't
document the process. Since the portable hard drive I put the
database on is in NTFS, I was not able to just plug it into the Red
Hat backup server and copy the files over. I copied the data to a
another box at corporate and used SSH to copy the .sql database to the
Red Hat server. Now I want to import the .sql file into the MySQL
database, but cannot get this working. I tried doing "mysql -u
username -p password datatbase < datatbase.sql" in Xterm, but that
didn't work, got some error. I downloaded MySQL admin tools and
installed them on the Red Hat box, and did a "restore", but it hosed
the machine up. So, to sum up:

1. How do I import the .sql database into MySQL?

2. When I tried to pull the database from the client site (W2K box)
using "mysqldump -u user -p pword database > database.sql"- when I
pushed enter, it just went to another line and gave me a ">" prompt.
Why did it do this? The reason I tried to do the mysqldump is I
thought maybe I pulled it wrong using the MySQL admin.

Thanks.

  Réponse avec citation
Vieux 13/10/2007, 23h06   #2
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

Sysop1911@gmail.com wrote:
> I'm trying to copy a sql database from our client office W2K box
> running MySQL to corporate office Red Hat (ver 4) box also running
> MySQL, how do I do this?
>
> I have a MySQL database at work, at the client site, running on a
> Windows 2000 server box. We have a backup box at our corporate office
> that we regularly (in theory) copy the MySQL database to. The backup
> box at our corporate office is running on Red Hat version 4. I need
> to copy the .sql database from the client site box-Windows 2000 server
> to the backup box- Red Hat. I was able to successfully pull the .sql
> database from the W2K box using MySQL Administrator. I can't figure
> out how to push the .sql database onto the Red Hat box at our
> corporate office. I am new to this job and the previous guy didn't
> document the process. Since the portable hard drive I put the
> database on is in NTFS, I was not able to just plug it into the Red
> Hat backup server and copy the files over. I copied the data to a
> another box at corporate and used SSH to copy the .sql database to the
> Red Hat server. Now I want to import the .sql file into the MySQL
> database, but cannot get this working. I tried doing "mysql -u
> username -p password datatbase < datatbase.sql" in Xterm, but that
> didn't work, got some error. I downloaded MySQL admin tools and
> installed them on the Red Hat box, and did a "restore", but it hosed
> the machine up. So, to sum up:
>
> 1. How do I import the .sql database into MySQL?
>
> 2. When I tried to pull the database from the client site (W2K box)
> using "mysqldump -u user -p pword database > database.sql"- when I
> pushed enter, it just went to another line and gave me a ">" prompt.
> Why did it do this? The reason I tried to do the mysqldump is I
> thought maybe I pulled it wrong using the MySQL admin.
>
> Thanks.


When you typed the mysqldump string, were you at the windows command prompt,
or had you started the mysql command line client?


  Réponse avec citation
Vieux 14/10/2007, 00h24   #3
Sysop1911@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
wrote:
> Sysop1...@gmail.com wrote:
> > I'm trying to copy a sql database from our client office W2K box
> > running MySQL to corporate office Red Hat (ver 4) box also running
> > MySQL, how do I do this?

>
> > I have a MySQL database at work, at the client site, running on a
> > Windows 2000 server box. We have a backup box at our corporate office
> > that we regularly (in theory) copy the MySQL database to. The backup
> > box at our corporate office is running on Red Hat version 4. I need
> > to copy the .sql database from the client site box-Windows 2000 server
> > to the backup box- Red Hat. I was able to successfully pull the .sql
> > database from the W2K box using MySQL Administrator. I can't figure
> > out how to push the .sql database onto the Red Hat box at our
> > corporate office. I am new to this job and the previous guy didn't
> > document the process. Since the portable hard drive I put the
> > database on is in NTFS, I was not able to just plug it into the Red
> > Hat backup server and copy the files over. I copied the data to a
> > another box at corporate and used SSH to copy the .sql database to the
> > Red Hat server. Now I want to import the .sql file into the MySQL
> > database, but cannot get this working. I tried doing "mysql -u
> > username -p password datatbase < datatbase.sql" in Xterm, but that
> > didn't work, got some error. I downloaded MySQL admin tools and
> > installed them on the Red Hat box, and did a "restore", but it hosed
> > the machine up. So, to sum up:

>
> > 1. How do I import the .sql database into MySQL?

>
> > 2. When I tried to pull the database from the client site (W2K box)
> > using "mysqldump -u user -p pword database > database.sql"- when I
> > pushed enter, it just went to another line and gave me a ">" prompt.
> > Why did it do this? The reason I tried to do the mysqldump is I
> > thought maybe I pulled it wrong using the MySQL admin.

>
> > Thanks.

>
> When you typed the mysqldump string, were you at the windows command prompt,
> or had you started the mysql command line client?


I think I tried it both ways. At the regular prompt and the 'mysql>'
prompt. Which way are you supposed to do it?

  Réponse avec citation
Vieux 14/10/2007, 00h40   #4
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1911@gmail.com> wrote:

> On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> wrote:
>> Sysop1...@gmail.com wrote:
>> > So, to sum up:

>>
>> > 1. How do I import the .sql database into MySQL?

>>
>> > 2. When I tried to pull the database from the client site (W2K box)
>> > using "mysqldump -u user -p pword database > database.sql"- when I
>> > pushed enter, it just went to another line and gave me a ">" prompt.
>> > Why did it do this? The reason I tried to do the mysqldump is I
>> > thought maybe I pulled it wrong using the MySQL admin.

>>
>> > Thanks.

>>
>> When you typed the mysqldump string, were you at the windows command
>> prompt,
>> or had you started the mysql command line client?

>
> I think I tried it both ways. At the regular prompt and the 'mysql>'
> prompt. Which way are you supposed to do it?


Just in the shell.

Getting a dump into a database I usually do in a mysql client though:

mysql> SOURCE /path/to/dump.sql;

(possibly with a foreign key check disable/reenable if the dump doesn't
contain it)
--
Rik Wasmus
  Réponse avec citation
Vieux 14/10/2007, 18h06   #5
Sysop1911@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Oct 13, 6:40 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1...@gmail.com> wrote:
> > On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> > wrote:
> >> Sysop1...@gmail.com wrote:
> >> > So, to sum up:

>
> >> > 1. How do I import the .sql database into MySQL?

>
> >> > 2. When I tried to pull the database from the client site (W2K box)
> >> > using "mysqldump -u user -p pword database > database.sql"- when I
> >> > pushed enter, it just went to another line and gave me a ">" prompt.
> >> > Why did it do this? The reason I tried to do the mysqldump is I
> >> > thought maybe I pulled it wrong using the MySQL admin.

>
> >> > Thanks.

>
> >> When you typed the mysqldump string, were you at the windows command
> >> prompt,
> >> or had you started the mysql command line client?

>
> > I think I tried it both ways. At the regular prompt and the 'mysql>'
> > prompt. Which way are you supposed to do it?

>
> Just in the shell.
>
> Getting a dump into a database I usually do in a mysql client though:
>
> mysql> SOURCE /path/to/dump.sql;
>
> (possibly with a foreign key check disable/reenable if the dump doesn't
> contain it)
> --
> Rik Wasmus


I got the .sql exported from the MySQL database (the one we have on
W2K). How do I import it into the already existing MySQL database on
our Red Hat box?

  Réponse avec citation
Vieux 14/10/2007, 19h26   #6
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

Sysop1911@gmail.com wrote:
> On Oct 13, 6:40 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1...@gmail.com> wrote:
>>> On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
>>> wrote:
>>>> Sysop1...@gmail.com wrote:
>>>>> So, to sum up:

>>
>>>>> 1. How do I import the .sql database into MySQL?

>>
>>>>> 2. When I tried to pull the database from the client site (W2K
>>>>> box) using "mysqldump -u user -p pword database > database.sql"-
>>>>> when I pushed enter, it just went to another line and gave me a
>>>>> ">" prompt. Why did it do this? The reason I tried to do the
>>>>> mysqldump is I thought maybe I pulled it wrong using the MySQL
>>>>> admin.

>>
>>>>> Thanks.

>>
>>>> When you typed the mysqldump string, were you at the windows
>>>> command prompt,
>>>> or had you started the mysql command line client?

>>
>>> I think I tried it both ways. At the regular prompt and the
>>> 'mysql>' prompt. Which way are you supposed to do it?

>>
>> Just in the shell.
>>
>> Getting a dump into a database I usually do in a mysql client though:
>>
>> mysql> SOURCE /path/to/dump.sql;
>>
>> (possibly with a foreign key check disable/reenable if the dump
>> doesn't contain it)
>> --
>> Rik Wasmus

>
> I got the .sql exported from the MySQL database (the one we have on
> W2K). How do I import it into the already existing MySQL database on
> our Red Hat box?


Have you considered reading the manual?


  Réponse avec citation
Vieux 15/10/2007, 13h37   #7
Sysop1911@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Oct 14, 1:26 pm, "Paul Lautman" <paul.laut...@btinternet.com>
wrote:
> Sysop1...@gmail.com wrote:
> > On Oct 13, 6:40 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> >> On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1...@gmail.com> wrote:
> >>> On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> >>> wrote:
> >>>> Sysop1...@gmail.com wrote:
> >>>>> So, to sum up:

>
> >>>>> 1. How do I import the .sql database into MySQL?

>
> >>>>> 2. When I tried to pull the database from the client site (W2K
> >>>>> box) using "mysqldump -u user -p pword database > database.sql"-
> >>>>> when I pushed enter, it just went to another line and gave me a
> >>>>> ">" prompt. Why did it do this? The reason I tried to do the
> >>>>> mysqldump is I thought maybe I pulled it wrong using the MySQL
> >>>>> admin.

>
> >>>>> Thanks.

>
> >>>> When you typed the mysqldump string, were you at the windows
> >>>> command prompt,
> >>>> or had you started the mysql command line client?

>
> >>> I think I tried it both ways. At the regular prompt and the
> >>> 'mysql>' prompt. Which way are you supposed to do it?

>
> >> Just in the shell.

>
> >> Getting a dump into a database I usually do in a mysql client though:

>
> >> mysql> SOURCE /path/to/dump.sql;

>
> >> (possibly with a foreign key check disable/reenable if the dump
> >> doesn't contain it)
> >> --
> >> Rik Wasmus

>
> > I got the .sql exported from the MySQL database (the one we have on
> > W2K). How do I import it into the already existing MySQL database on
> > our Red Hat box?

>
> Have you considered reading the manual?- Hide quoted text -
>
> - Show quoted text -


The manual at Mysql.com? Yes, I looked there. It said to do a "mysql
-u
username -p password datatbase < datatbase.sql" command at the Xterm,
but it didn't work. I got an error message.

Have you ever restored a SQL database to mysql? How did you do it?

  Réponse avec citation
Vieux 15/10/2007, 13h55   #8
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On 15 Oct, 12:37, Sysop1...@gmail.com wrote:
> On Oct 14, 1:26 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> wrote:
>
>
>
>
>
> > Sysop1...@gmail.com wrote:
> > > On Oct 13, 6:40 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> > >> On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1...@gmail.com> wrote:
> > >>> On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> > >>> wrote:
> > >>>> Sysop1...@gmail.com wrote:
> > >>>>> So, to sum up:

>
> > >>>>> 1. How do I import the .sql database into MySQL?

>
> > >>>>> 2. When I tried to pull the database from the client site (W2K
> > >>>>> box) using "mysqldump -u user -p pword database > database.sql"-
> > >>>>> when I pushed enter, it just went to another line and gave me a
> > >>>>> ">" prompt. Why did it do this? The reason I tried to do the
> > >>>>> mysqldump is I thought maybe I pulled it wrong using the MySQL
> > >>>>> admin.

>
> > >>>>> Thanks.

>
> > >>>> When you typed the mysqldump string, were you at the windows
> > >>>> command prompt,
> > >>>> or had you started the mysql command line client?

>
> > >>> I think I tried it both ways. At the regular prompt and the
> > >>> 'mysql>' prompt. Which way are you supposed to do it?

>
> > >> Just in the shell.

>
> > >> Getting a dump into a database I usually do in a mysql client though:

>
> > >> mysql> SOURCE /path/to/dump.sql;

>
> > >> (possibly with a foreign key check disable/reenable if the dump
> > >> doesn't contain it)
> > >> --
> > >> Rik Wasmus

>
> > > I got the .sql exported from the MySQL database (the one we have on
> > > W2K). How do I import it into the already existing MySQL database on
> > > our Red Hat box?

>
> > Have you considered reading the manual?- Hide quoted text -

>
> > - Show quoted text -

>
> The manual at Mysql.com? Yes, I looked there. It said to do a "mysql
> -u
> username -p password datatbase < datatbase.sql" command at the Xterm,
> but it didn't work. I got an error message.
>
> Have you ever restored a SQL database to mysql? How did you do it?- Hide quoted text -
>
> - Show quoted text -


"it didn't work. I got an error message."
Sheesh, how often do I read those words on this site! If the manual
told you that was the command to use, then that IS the command to use.

You got an error message huh! So, instead of saying "I tried this
command ... that the manual said I should use and I got this error
message ... Can anyone point me to what might be causing it?", you
post a question "How do I import it into the already existing MySQL
database...", which would elicit the answer that the manual gave.

Then when you do FINALLY tell us that you tried the correct command
and got an error, you don't even bother to think that maybe telling us
what the error message is might just us to you!

  Réponse avec citation
Vieux 15/10/2007, 18h00   #9
Sysop1911@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Oct 15, 7:55 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 15 Oct, 12:37, Sysop1...@gmail.com wrote:
>
>
>
>
>
> > On Oct 14, 1:26 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> > wrote:

>
> > > Sysop1...@gmail.com wrote:
> > > > On Oct 13, 6:40 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> > > >> On Sun, 14 Oct 2007 00:24:32 +0200, <Sysop1...@gmail.com> wrote:
> > > >>> On Oct 13, 5:06 pm, "Paul Lautman" <paul.laut...@btinternet.com>
> > > >>> wrote:
> > > >>>> Sysop1...@gmail.com wrote:
> > > >>>>> So, to sum up:

>
> > > >>>>> 1. How do I import the .sql database into MySQL?

>
> > > >>>>> 2. When I tried to pull the database from the client site (W2K
> > > >>>>> box) using "mysqldump -u user -p pword database > database.sql"-
> > > >>>>> when I pushed enter, it just went to another line and gave me a
> > > >>>>> ">" prompt. Why did it do this? The reason I tried to do the
> > > >>>>> mysqldump is I thought maybe I pulled it wrong using the MySQL
> > > >>>>> admin.

>
> > > >>>>> Thanks.

>
> > > >>>> When you typed the mysqldump string, were you at the windows
> > > >>>> command prompt,
> > > >>>> or had you started the mysql command line client?

>
> > > >>> I think I tried it both ways. At the regular prompt and the
> > > >>> 'mysql>' prompt. Which way are you supposed to do it?

>
> > > >> Just in the shell.

>
> > > >> Getting a dump into a database I usually do in a mysql client though:

>
> > > >> mysql> SOURCE /path/to/dump.sql;

>
> > > >> (possibly with a foreign key check disable/reenable if the dump
> > > >> doesn't contain it)
> > > >> --
> > > >> Rik Wasmus

>
> > > > I got the .sql exported from the MySQL database (the one we have on
> > > > W2K). How do I import it into the already existing MySQL database on
> > > > our Red Hat box?

>
> > > Have you considered reading the manual?- Hide quoted text -

>
> > > - Show quoted text -

>
> > The manual at Mysql.com? Yes, I looked there. It said to do a "mysql
> > -u
> > username -p password datatbase < datatbase.sql" command at the Xterm,
> > but it didn't work. I got an error message.

>
> > Have you ever restored a SQL database to mysql? How did you do it?- Hide quoted text -

>
> > - Show quoted text -

>
> "it didn't work. I got an error message."
> Sheesh, how often do I read those words on this site! If the manual
> told you that was the command to use, then that IS the command to use.
>
> You got an error message huh! So, instead of saying "I tried this
> command ... that the manual said I should use and I got this error
> message ... Can anyone point me to what might be causing it?", you
> post a question "How do I import it into the already existing MySQL
> database...", which would elicit the answer that the manual gave.
>
> Then when you do FINALLY tell us that you tried the correct command
> and got an error, you don't even bother to think that maybe telling us
> what the error message is might just us to you!- Hide quoted text -
>
> - Show quoted text -


Okay, I log into MySQL, so I have the 'mysql>' prompt. Then I type
'mysql databasename < datatoimportname.sql' and hit <enter> and it
goes to the next line and gives me a '->' prompt. What am I doing
wrong?" I just want to import the database from the .sql file into
the already exisiting datatbase. This is all on a Red Hat Linux
version 4 box.

  Réponse avec citation
Vieux 15/10/2007, 22h39   #10
Kees Nuyt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Import sql datatbase into MySQL on Red Hat v. 4

On Mon, 15 Oct 2007 09:00:45 -0700, Sysop1911@gmail.com
wrote:

> Okay, I log into MySQL, so I have the 'mysql>' prompt.
> Then I type
> mysql databasename < datatoimportname.sql'
> and hit <enter>


Type :
mysql \
-u yourusername \
-pyourpassword databasename \
<datatoimportname.sql

from your bash prompt.
--
( Kees
)
c[_] A language is a dialect with an army and a navy. (#136)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 4,36607 seconds with 18 queries