Visualizzazione post con etichetta InfoBright. Mostra tutti i post
Visualizzazione post con etichetta InfoBright. Mostra tutti i post

giovedì 21 giugno 2012

MySql - Salvataggio di tabella su file

Salvataggio di tabella su file:
SELECT * FROM prova
INTO OUTFILE '/mnt/prova.csv'
FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';

Se Infobright potrebbe dare il seguente errore:
The query includes syntax that is not supported by the Infobright Optimizer. Either restructure the query with supported syntax, or enable the MySQL Query Path in the brighthouse.ini file to execute the query with reduced performance. 

Per risolverlo eseguire prima lo statement:
set @bh_dataformat = 'txt_variable';

Caricamento da file:
LOAD DATA INFILE '/mnt/prova.csv' INTO TABLE prova1

martedì 9 agosto 2011

Installazione MySQL e InfoBright su Centos

Come verificare la versione del sistema operativo:
uname -a
MySQL
INSTALLAZIONE: yum -y install mysql mysql-server
REGISTRAZIONE SERVIZIO:/sbin/chkconfig mysqld on
START: /sbin/service mysqld start
STOP: /sbin/service mysqld stop
CONNESSIONE:  mysql -h localhost -u root -p
Configurazione: vi /etc/my.cnf

InfoBright
Scaricare e unzippare
START IB: /etc/init.d/mysqld-ib start
STOP IB: /etc/init.d/mysqld-ib stop
Configurazione: vi /etc/my-ib.cnf