Recently, i worked with MS SQL Server and i needed to backup a table. With Mysql database, this is a simple job. Infact , i think that mysqldump is very simple and quickly method. SQL Server provide with Management Studio an automatic backup also easy to use, but this permit to backup only the entire Db. After some google search i found the solution, bcp command, follow a sample.
For backup a table from my db i wrote :
bcp mydb.mytable OUT c:\export.txt -n -S dbserver -T
and to restore :
bcp mydb.mytable IN c:\import.txt -n -S dbserver -T
Where the parameters :
-n -> maintains the native type of the table
-S -> the db server
-T -> trusted connection
There are many other options, see the image below.

ww
Di recente mi sono imbattuto in un problema legato alla mia labile memoria, avevo smarrito la mia password per il Server MySQL!!
Per evitare che qualcuno di voi disinstalli tutto per poi reinstallare da zero MySQL(Fatto dal sottoscritto tempo fà
), vi spiego quali sono i passi da seguire:
- Essere certi di aver fatto il login di Windows da Amministratore.
- Arrestare il Server MySQL da :
Start -> Pannello di Controllo -> Strumenti di Amministrazione -> Servizi
- Creare un file di testo con il seguente contenuto :
UPDATE mysql.user SET Password=PASSWORD('Nuovapassword') WHERE User='root';
FLUSH PRIVILEGES;
Copiare esattamente le dure righe così come sono, cambiando la password..naturalmente.
- Salvare il file, per esempio
c:\mysql_init.txt(Il percorso del file è ininfluente)
- Aprire la console di Windows facendo:
Start -> Esegui -> cmd
- Infine riavviare il server MySQL digitando al prompt :
c:\Programmi\MySQL\MySQLServerXXX\mysqld --init-file=C:\mysql_init.txt
Dove XXX è la vostra versione di MySQL.
Fatto!
Grazie alla MySQL Reference!! A presto.