Home| Progetto| Web| Faq| Acronimi | ||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Oracle...
Script:
Cercare le colonne in uno schema
Unix...
Tip:
How remove a file named -r
PLSQL...
Script:
Esempio funzione MOD
Mysql...
Tip:
How execute a sql script within mysql shell
Mysql...
Faq:
How do I change my database password?
Shell scripting...
Script:
Looping samples
A User Agent, like a web browser, uses HTTP to request a HTML document
Php Funzione mail()
In programming the danger of exploring the small details of coding is that you get obsessed with every line of code you write, thereby greatly reducing productivity.
In general, is not worth obsessing over code. On the other hand you should code with deliberation and intent. Steven Feurstein Oracle Magazine July /August 2004 A User Agent, like a web browser, uses HTTP to request a HTML document
|
Mysql
Home >Mysql > mysql load file into a table
LOAD_FILE is a mysql function to load files on a table. For example, let's create a simple text file and make sure mysql has the rights. server1 ~ $ echo 'Hello I am a nice text file!' > /tmp/test.txt server1 ~ $ chown mysql:mysql /tmp/test.txt server1 ~ $ mysql Server version: 5.6.21-70.0-log Percona Server (GPL), Release 70.0, Revision 688 mysql> use demodb ; Database changed mysql> CREATE TABLE -> `test` ( `id` bigint(20) NOT NULL, `data` longblob, -> `file_type` varchar(20) DEFAULT NULL, -> PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; Query OK, 0 rows affected (0.01 sec) mysql> INSERT INTO test (id, data) VALUES(1, LOAD_FILE('/tmp/test.txt')); Query OK, 1 row affected (0.00 sec) mysql> select * from test; +----+-------------------------------+-----------+ | id | data | file_type | +----+-------------------------------+-----------+ | 1 | Hello I am a nice text file! | NULL | +----+-------------------------------+-----------+ 1 row in set (0.00 sec) For example if max_allowed_packet is set to 16M while trying to insert a 20M file you will get the "Warning 1301". -- max_allowed_packet is set to 16M mysql> show variables like 'max_allowed_packet' ; +--------------------+----------+ | Variable_name | Value | +--------------------+----------+ | max_allowed_packet | 16777216 | +--------------------+----------+ 1 row in set (0.00 sec) -- max_allowed_packet is set to 16M mysql> INSERT INTO test (id, data) VALUES(2, LOAD_FILE('/tmp/sample_file_20Msize.pdf')); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+---------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------------------------------+ | Warning | 1301 | Result of load_file() was larger than max_allowed_packet (16777216) - truncated | In this case you will need to increase accordingly the value on the configuration file (usually my.cnf) and reload mysql server . Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() ![]() ![]() ![]() ![]() ![]() Script ![]() ![]() Comandi ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
CercaAnger is creative, depression is useless.
Dyson, Freeman J. Anger is creative, depression is useless.
Dyson, Freeman J.
Oracle...
Definizioni:
Schema and user
Shell scripting...
Script:
Array
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |