Archive

Posts Tagged ‘MySQL’

Backup MS SQL Table

February 16th, 2010 No comments

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

Resettare password MySQL

May 1st, 2009 No comments

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à :-P ), vi spiego quali sono i passi da seguire:

  1. Essere certi di aver fatto il login di Windows da Amministratore.
  2. Arrestare il Server MySQL da :
  3. Start  -> Pannello di Controllo -> Strumenti di Amministrazione -> Servizi

  4. Creare un file di testo con il seguente contenuto :
  5. UPDATE mysql.user SET Password=PASSWORD('Nuovapassword') WHERE User='root';
    FLUSH PRIVILEGES;

    Copiare esattamente le dure righe così come sono, cambiando la password..naturalmente.

  6. Salvare il file, per esempio c:\mysql_init.txt(Il percorso del file è ininfluente)
  7. Aprire la console di Windows facendo:
  8. Start -> Esegui -> cmd

  9. 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.



Tags: ,