|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Sometimes I have to make a replica on a remote mysql database... how can
I do? i tried with the backup utility but it will update also the data... I only want the schema to be updated. anyone can me? there's an utility to do it? thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht news:HSMfj.37278$8j3.12436@tornado.fastwebnet.it.. . > Sometimes I have to make a replica on a remote mysql database... how can I > do? i tried with the backup utility but it will update also the data... I > only want the schema to be updated. > anyone can me? there's an utility to do it? > thanks phpmyadmin pick 'export' and uncheck 'data' |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Sat, 05 Jan 2008 15:54:36 +0100, "Dr. Fred on Vista"
<diealp@gmail.com> wrote: >Sometimes I have to make a replica on a remote mysql database... how can >I do? i tried with the backup utility but it will update also the >data... I only want the schema to be updated. >anyone can me? there's an utility to do it? >thanks mysqldump -- Look for --no-data Mysqldump is not a conversion utility that automagically re-imports the data for you. It will not update the schema, but rather create it, so you will loose the data. If you : 1) backup the new schema with --no-data 2) backup the old schema with --no-data 3) backup the old data with --no-create-info 4) create the new schema w 5) execute the INSERTs in the dump from 3) you may get your data back, if all unchanged column definitions still have the same name. Any new columns will be populated with their default value, or with NULL if there is on default. INSERTs will fail if there is a NOT NULL constraint on any new columns. INSERTs will also fail if columns have been deleted in the new schema (relative to the old one). HTH -- ( Kees ) c[_] Acts speak louder than words. (#208) |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Kees Nuyt ha scritto:
> On Sat, 05 Jan 2008 15:54:36 +0100, "Dr. Fred on Vista" > <diealp@gmail.com> wrote: > >> Sometimes I have to make a replica on a remote mysql database... how can >> I do? i tried with the backup utility but it will update also the >> data... I only want the schema to be updated. >> anyone can me? there's an utility to do it? >> thanks > > mysqldump -- > > Look for --no-data > > Mysqldump is not a conversion utility that automagically > re-imports the data for you. It will not update the > schema, but rather create it, so you will loose the data. > > If you : > 1) backup the new schema with --no-data > 2) backup the old schema with --no-data > 3) backup the old data with --no-create-info > 4) create the new schema w > 5) execute the INSERTs in the dump from 3) > you may get your data back, if all unchanged column > definitions still have the same name. > > Any new columns will be populated with their default > value, or with NULL if there is on default. > > INSERTs will fail if there is a NOT NULL constraint on any > new columns. > > INSERTs will also fail if columns have been deleted in the > new schema (relative to the old one). > > HTH thanks for the infos... I'll check this utility ![]() bye |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Luuk ha scritto:
> "Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht > news:HSMfj.37278$8j3.12436@tornado.fastwebnet.it.. . >> Sometimes I have to make a replica on a remote mysql database... how can I >> do? i tried with the backup utility but it will update also the data... I >> only want the schema to be updated. >> anyone can me? there's an utility to do it? >> thanks > > phpmyadmin > pick 'export' > and uncheck 'data' i have to install phpmyadmin in my local machine... don't you know a "normal" software? ![]() |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
"Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht news:WNOfj.37385$8j3.3827@tornado.fastwebnet.it... > Luuk ha scritto: >> "Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht >> news:HSMfj.37278$8j3.12436@tornado.fastwebnet.it.. . >>> Sometimes I have to make a replica on a remote mysql database... how can >>> I do? i tried with the backup utility but it will update also the >>> data... I only want the schema to be updated. >>> anyone can me? there's an utility to do it? >>> thanks >> >> phpmyadmin >> pick 'export' >> and uncheck 'data' > > i have to install phpmyadmin in my local machine... don't you know a > "normal" software? ![]() phpmyadmin can be installed on the remote server (where mysql is installed) and you did not specify which "backup utility" u use, so i gave you this option, a lot of providers, who give access to MySQL, also provide phpmyadmin and i consider phpmyadmin to be "normal" software... ;-) |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Luuk ha scritto:
> "Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht > news:WNOfj.37385$8j3.3827@tornado.fastwebnet.it... >> Luuk ha scritto: >>> "Dr. Fred on Vista" <diealp@gmail.com> schreef in bericht >>> news:HSMfj.37278$8j3.12436@tornado.fastwebnet.it.. . >>>> Sometimes I have to make a replica on a remote mysql database... how can >>>> I do? i tried with the backup utility but it will update also the >>>> data... I only want the schema to be updated. >>>> anyone can me? there's an utility to do it? >>>> thanks >>> phpmyadmin >>> pick 'export' >>> and uncheck 'data' >> i have to install phpmyadmin in my local machine... don't you know a >> "normal" software? ![]() > > phpmyadmin can be installed on the remote server (where mysql is installed) > and you did not specify which "backup utility" u use, > so i gave you this option, a lot of providers, who give access to MySQL, > also provide phpmyadmin > and i consider phpmyadmin to be "normal" software... ;-) sorry... I didnt specified all (I'm not english, sorry)... I have a local mysql DB (it's my test platform) and sometimes i have to update the remote db schema to make it similar to the local one. so, I dont think i can use phpmyadmin (installed on my hosting) toread the local db. thanks! |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Sat, 05 Jan 2008 18:01:13 +0100, Kees Nuyt
<k.nuyt@nospam.demon.nl> wrote: Oops, I dropped some text there >If you : >1) backup the new schema with --no-data >2) backup the old schema with --no-data >3) backup the old data with --no-create-info >4) create the new schema w should be: 4) create the new schema with the dump off 1) But you probably already figured that out. >5) execute the INSERTs in the dump from 3) Regards, -- ( Kees ) c[_] I drink to make other people interesting. (#121) |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
> sorry... I didnt specified all (I'm not english, sorry)... I have a > local mysql DB (it's my test platform) and sometimes i have to update > the remote db schema to make it similar to the local one. > so, I dont think i can use phpmyadmin (installed on my hosting) to> read the local db. > > thanks! Depending on what platform your workstation is, you could check out Navicat. I use that to manage all of the mysql databases I work with and it does have a schema sync tool that gives you granularity as to what tables / columns need to be synced. Not free, but well worth the $99 (I think that's the price). |
|
![]() |
| Outils de la discussion | |
|
|