|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
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! |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
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) |
|
![]() |
| Outils de la discussion | |
|
|