Host Unlimited Web Sites for Only $10 per Month! Web ospitante illimitati siti per soli $ 10 al mese!
Powered by MaxBlogPress Powered by MaxBlogPress

Come per l'esportazione e l'importazione molto grandi basi di dati di MySQL | JTPRATT del blogging Errori
JTPratt del blogging errori





Home Home page » How to export and import very large mySQL databases »Come esportare e importare molto grandi basi di dati di MySQL



Posted in: Posted in:

blog-setup categoria immagineblogging-errori categoria immagineDrupal categoria immagineWeb-hosting immagine categoriawordpress categoria immagine
8,713 views 8713 opinioni


Please note: This page was originally written in English. Attenzione: Questa pagina è stata originariamente scritto in inglese.

The original post can be viewed Il post originale può essere visualizzato here qui .

Please note: This page was originally written in English.

The text has been translated using an online service such as Google or Babelfish.

The original post can be viewed here.


I had a very large web site (30,000+ pages) that I wanted to move from one web host to another. Ho avuto un grande sito web (+ 30.000 pagine) che ho voluto passare da un host web ad un altro. Normally I would use phpMyAdmin to export tables or the entire database. Normalmente io uso phpMyAdmin per esportare le tabelle o l'intero database. This mySQL database was of course too large for that and phpMyAdmin would timeout trying to export, even if I exported only one table at a time (one table had 1.5 million records). Questo database mySQL era ovviamente troppo grande per phpMyAdmin e che avrebbe timeout cercando di esportazione, anche se ho esportato solo una tabella in un momento (una tabella aveva 1,5 milioni di record). It’s very easy to quickly export and import very, very large mySQL databases with even hundreds of thousands of records. E 'molto facile rapidamente l'esportazione e l'importazione molto, molto grandi basi di dati di MySQL anche con centinaia di migliaia di record.

To accomplish this we can’t do it via web page tools or methods. Per questo non possiamo farlo tramite pagina web strumenti o metodi. So, we have to use the command line in UNIX. Quindi, dobbiamo utilizzare la riga di comando in UNIX. This will require a telnet (preferably secure telnet) account and a basic understanding on simple UNIX commands. Ciò richiederà un telnet (preferibilmente telnet sicuro) e conto di una comprensione di base su semplici comandi UNIX. You will also enough disk space free to extract your database. È anche abbastanza spazio libero su disco per estrarre il database. If you don’t have telnet access to your web site, you can always submit a support ticket telling them what to do based on these instructions. Se non si dispone di accesso via telnet al vostro sito web, puoi inviare una richiesta di assistenza dicendo loro che cosa fare sulla base di queste istruzioni. You will need to know in advance your database name, your database username and password, and whether or not your server is ‘localhost’ or a server name (and what it is). Hai bisogno di sapere in anticipo il tuo nome del database, il database utente e la password, e se rappresentino o no il tuo server è 'localhost' o un nome di server (e quello che è). This information is normally already entered in your site’s database config or settings file. Questa informazione è normalmente già entrato nel vostro sito database di configurazione o le impostazioni del file. If you are using Wordpress it’s in your /wp-config.php file in the root of your site, if you’re using Drupal it’s stored in your /sites/default/settings.php file. Se si utilizza Wordpress è nel tuo / wp-config.php file nella root del vostro sito, se si sta utilizzando Drupal è immagazzinato in / siti / default / settings.php file.

Here are the instructions to export your mySQL database into one file on the UNIX command line: Qui ci sono le istruzioni per esportare il database mySQL in un file sulla riga di comando UNIX:

  • login to your web site using telnet Accedi al tuo sito web utilizzando telnet
  • navigate to the directory where you want to store your extracted database file passare alla directory in cui si desidera memorizzare il file di database di estratti
  • run the following on the command line: eseguire il seguente sulla riga di comando:
    mysqldump -a -u USERNAME -p DATABASE > FILENAME.mysql mysqldump-a-u-p USERNAME DATABASE> FILENAME.mysql
  • check the size of your file (command: ls -al) verificare le dimensioni del file (comando: ls-al)
  • gzip your file to make the download faster using the command: gzip FILENAME.mysql gzip il file per rendere il download più veloce con il comando: gzip FILENAME.mysql
  • download your file in ftp to your local pc to upload and import into your new database Scarica il file in ftp al vostro PC locale e per caricare il tuo importazione nella nuova banca dati

Again, if you don’t have telnet access you can probably submit a ticket at your web host and they will extract the file for you so you can download it. Anche in questo caso, se non si dispone di accesso via telnet si può probabilmente presentare un biglietto presso il tuo host Web e si estrarre il file per voi in modo che tu possa scaricarlo. Once downloaded you need to upload the file to your new web host so you can import it into a fresh database. Una volta scaricato è necessario caricare il file sul tuo nuovo host web in modo da poter importare in un nuovo database. First, I want to make you aware of a PHP script called In primo luogo, vorrei mettere l'utente al corrente di uno script PHP chiamato Big Dump Big Dump that does a ’staggered import’ of mysql files into a new database. che fa un 'importazione scaglionati' di MySQL file in un nuovo database. Even though it’s staggered (importing in chunks) it has it’s limits. Anche se è scaglionato (importazione in pezzi) che dispone di limiti. I have successfully used it many times on databases under 50MB. Ho usato con successo molte volte in apposite banche dati sotto 50MB. It has also failed miserably for me on a 191MB database. Essa ha anche fallito miseramente per me su un database di 191MB. If your database is too big to import using phpMyAdmin but under 50MB - give it a try first. Se il database è troppo grande per l'importazione utilizzando phpMyAdmin, ma sotto 50MB - dare una prova prima. Otherwise you’ll have to import on the command. In caso contrario dovrete importare il comando. If you use Big Dump you just enter your mysql server settings into the file itself, and I have had the best results uploading the mysql file to the server (same dir you place bigdump.php in) and hardcode the filename into the file before trying the import. Se si utilizza Big Dump basta inserire il vostro server MySQL impostazioni nel file stesso, e ho avuto i migliori risultati di caricare il file di MySQL server (stesso luogo dir si bigdump.php in) compilazione e il nome del file in un file prima di tentare l'importazione.

Now, if your file is >50MB or bigdump.php doesn’t work - I’m going to show you how to do a manual import of your mysql file: Ora, se il file è> 50 MB o bigdump.php non funziona - Io vado a mostrarvi come fare un manuale di importazione dei tuoi file di mysql:

  • upload your mysql file to your new web site mysql caricare il tuo file sul nuovo sito web
  • create a new blank database using myPHPAdmin creare un nuovo database vuoto utilizzando myPHPAdmin
  • note your database username and password, and your mysql servername nota il database utente e la password, e il vostro server MySQL
  • unzip your database file with this command: gzip -d FILENAME.mysql decomprimere il tuo file di database con il comando: gzip-d FILENAME.mysql
  • run the following on the command line to import: eseguire il seguente sulla riga di comando per importare:
    mysql -u USERNAME -p DATABASE < FILENAME.mysql mysql-u USERNAME DATABASE-p <FILENAME.mysql
  • check your database in myPHPAdmin to make sure all the tables imported properly verificare la vostra base di dati nei myPHPAdmin per assicurarsi che tutte le tabelle importate correttamente

That’s it! Questo è tutto! You’ve now learned how to successfully export and import large mySQL databases when myPHPAdmin or other tools won’t work! Ora che hai imparato al successo di esportazione e importazione grandi basi di dati di MySQL quando myPHPAdmin o altri strumenti non funziona! Again, if you don’t have telnet access, you can always ask your (new) web host to import the file for you. Anche in questo caso, se non si dispone di accesso via telnet, puoi chiedere il vostro (nuovo) host web di importare i file per voi. I did when I migrated from a host I used for 9 years to goDaddy. L'ho fatto quando ho migrato da un host che ho usato per 9 anni a GoDaddy. They don’t offer telnet access, so I uploaded the 191MB mysql file and gave them a call to submit a ticket. Essi non offrono l'accesso telnet, così ho caricato il file di 191MB mysql e ha dato loro un invito a presentare un biglietto. In less than 2 hours the import was done and I was very happy! In meno di 2 ore l'importazione è stato fatto e mi è stato molto felice!

I’ve had a lot of people ask my why I use goDaddy, and I have to tell you…I have hosted with dozens of companies. Ho avuto un sacco di persone lo chiederà il motivo per cui il mio io uso GoDaddy, e devo dirvi ... mi hanno ospitato con decine di imprese. I actually setup a small account with goDaddy 6 months ago just to try it out (it was only $3.99 per month). Ho effettivamente installare un piccolo conto con GoDaddy 6 mesi fa solo per provarlo (è stato solo $ 3.99 al mese). Now, 6 months later I’ve moved everything to them. Ora, 6 mesi più tardi ho spostato tutto a loro. All of my domain registrations, and all of my sites are completely hosted with goDaddy as of today (that big web site was the last one!). Tutte le mie registrazioni dei domini, e tutti i miei siti sono completamente ospitato con GoDaddy come di oggi (che grande sito web è stato l'ultimo!). I was paying $29.99 per month for a professional webmaster account. Sono stato pagando $ 29.99 al mese per i webmaster di un professionista conto. I get the exact same thing (and more) with goDaddy for $14.99 per month. Ho la stessa identica cosa (e più) con GoDaddy per $ 14,99 al mese. They have deals all the time where I pickup new domains for $1.99, and they had a special just today (when I called about the database import) where in July all web hosting was 25% off. Essi hanno le offerte per tutto il tempo in cui mi ritiro nuovi domini per $ 1,99, e avevano una speciale solo oggi (quando ho chiamato la banca dati di importazione), dove nel mese di luglio tutti i web hosting, è stato del 25% di sconto. It’s not just 25% off for new customers - it’s 25% off for ALL customers, whether you upgrade or just want to pay ahead. Non si tratta solo 25% di sconto per i nuovi clienti - è 25% di sconto per tutti i clienti, se si aggiorna o si desidera pagare in anticipo. So I paid up a few months in advance to save even more money. Così ho pagato fino a pochi mesi di anticipo per risparmiare ancora più soldi. That’s my shameless self-promotion for the day - use the host I use: Questo è il mio spudorato auto-promozione per il giorno - l'uso di accoglienza utilizzare: www.GoDaddy.com

*UPDATE* * UPDATE *

I almost forgot to add why this was a ‘blogging mistake’!  I was going to migrate all of my web sites to goDaddy last month.  I setup a new account a moved all but 2 or 3 sites - mainly because I couldn’t figure out how to get those huge databases off my old server and into my goDaddy account.  Because I couldn’t figure it out my monthly hosting renewal came up, and I ended up paying for another month.  Since I had a dedicated server (that I was grossly under utilizing), that blogging mistake ended up costing me $214!!  Then I finally did a quick google search for “export large mysql database” and figured it out in an hour.  My mistake was not doing enough research to fix the problem - it’s not like I was tackling something others hadn’t been through (and documented) before.  Google is your friend - always search for solutions to your problems! Ho quasi dimenticato di aggiungere il motivo per cui questo è stato un 'errore di blog'! Ã,  Stavo per migrare tutti i miei siti web di GoDaddy ultimo month.Ã,  ho configurato un nuovo account uno spostato tutti, ma 2 o 3 siti - principalmente perché non riuscivo a capire come ottenere queste enormi banche dati off mio vecchio server e in considerazione il mio GoDaddy,  Perché non ho potuto figura fuori il mio rinnovo mensile di hosting si avvicinò, e ho finito per pagare per un altro mese. Ã,  Poiché ho avuto un server dedicato (che mi è stato gravemente utilizzando sotto), che bloggare finito per errore mi costa $ 214! Ã,  Poi ho finalmente fatto una rapida ricerca google per "esportare grandi database mysql" e figurato fuori in un hour.Ã,  Il mio sbaglio è stato non fa abbastanza ricerca per risolvere il problema - non è come mi è stato qualcosa di affrontare altri non era stato attraverso (e documentato) before.Ã, un account Google è il tuo amico - semper ricerca per trovare la soluzione ai tuoi problemi!


8 Responses to “How to export and import very large mySQL databases” 8 Responses to "Come per l'esportazione e l'importazione molto grandi basi di dati di MySQL"

  1. nouffer.info.technology » Blog Archive » How to Import Large MySQL Data Files nouffer.info.technology »Blog Archive» Come importare grossi file di dati di MySQL Has the following to say... Ha le seguenti dire ...

    [...] How to export and import very large mySQL databases [...] [...] Come per l'esportazione e l'importazione molto grandi basi di dati di MySQL [...]

  2. Nada Insyirah » How to Import Large MySQL Data Files Nada Insyirah »Come importare grandi file di dati di MySQL Has the following to say... Ha le seguenti dire ...

    [...] How to export and import very large mySQL databases [...] [...] Come per l'esportazione e l'importazione molto grandi basi di dati di MySQL [...]

  3. konijnenhokken konijnenhokken Has the following to say... Ha le seguenti dire ...

    thanks a lot for this post, i am using it right now to transfer over my dbases (190mb+) to my new server! grazie molto per questo post, io sto usando subito a trasferire il mio dbases (190 MB +) per il mio nuovo server!

    bookmarked for pleasure! segnalibro per piacere! tjanks!

  4. Andrés Mochi Andrà© s Mochi Has the following to say... Ha le seguenti dire ...

    = Good info mate. Buona info mate. I needed that ^^ Che avevo bisogno ^ ^

    Thanks a lot!!! Grazie tante!

  5. fedmich fedmich Has the following to say... Ha le seguenti dire ...

    I’m encountering same problems now.. Sto incontrando problemi stessa ora .. Im importing a 2Million records of lyrics, artis, etc. int a website and the SQL Dump is more than 400MB of dump file. Im 2Million importare un record di testo, artis, ecc int un sito web e SQL Dump è più di 400MB di file. I’m splitting and uploading them at the moment, but Im sure there’sa better way of doing this. Sto caricando la divisione e loro in questo momento, ma Im sicuro c'è modo migliore di farlo. Any software (I’ll buy it) there or PHP scripts. Qualsiasi software (I'll acquistarlo) o vi script PHP. THanks in advance Grazie in anticipo

    fedmich’s last blog post.. fedmich l'ultimo post sul blog .. Fedmich Computer Shop on Manila Times closed Fedmich negozio di computer a Manila Times chiuso

  6. GeoSathi GeoSathi Has the following to say... Ha le seguenti dire ...

    It is a good article about the mysql database regarding to import a heavier one. Si tratta di un buon articolo su database mysql in materia di importare un pesante uno.

    Excellent Eccellente

    By Di

    GeoSathi
    http://www.geosathi.com

  7. Sniper4Dz Has the following to say... Sniper4Dz ha le seguenti dire ...

    this is error si tratta di errore

    ERROR 1231 (42000) at line 4082: Variable ’sql_mode’ can’t be set to the value of ‘Null’ ERRORE 1231 (42000) alla riga 4082: Variabile 'sql_mode' non può essere impostata al valore di 'null'

  8. Prakash Has the following to say... Prakash ha le seguenti dire ...

    Thanks, gr8 help for me Grazie, GR8 aiuto per me

Question or Comment?? Domanda o commento? Spill it Now... Spill comprare ...

Saltando di gioia su commenti!

We Reward Comments! Abbiamo ricompensa commenti!


We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! Abbiamo dofollow link, e ottenere il tuo ultimo post sul blog come sottotitolo sotto ogni nuovo commento dal "CommentLuv" plugin! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! Top commenters per ogni mese sono riportati su ogni pagina di questo sito in una barra laterale widget collegate al suo URL! We would like to reward you for becoming part of our community! Vorremmo che vi ricompensi per diventare parte della nostra comunità! Your comment is valuable not only to us, but also all the other readers of this blog! Il tuo commento è prezioso non solo per noi, ma anche tutti gli altri lettori di questo blog!


Click to add smilies to your post! Fare clic per aggiungere Faccine per il tuo post! == []^ = (= ((= (|=) r= | 8= 0=) ~= 00= (=;=)]=;;;