TipGiver
Programmer
- Sep 1, 2005
- 1,863
Hi,
i'm new to SQL and generally just started 'dealing' with databases.
All i need is to insert data from the disk to a table.
The Text File:
30434 menios
30567 dimitris
30666 skatas
30123 testing
SQL syntax:
mysql> load data local infile 'c:\\sub.txt' into table m;
Query OK, 4 rows affected (0.00 sec)
Records: 4 Deleted: 0 Skipped: 0 Warnings: 0
mysql> select * from m;
+-------+-----------+
| am | name |
+-------+-----------+
|434 | menios
|30567 | dimitris
|666 | skatas
| 30123 | testing |
+-------+-----------+
4 rows in set (0.00 sec)
Why is that happening?
- my PC: MySQL last version (5. ..), win32
- It works fine under linux!
'Describe' of m table
mysql> describe m
-> ;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| am | int(11) | YES | | NULL | |
| name | varchar(10) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
Tnx
i'm new to SQL and generally just started 'dealing' with databases.
All i need is to insert data from the disk to a table.
The Text File:
30434 menios
30567 dimitris
30666 skatas
30123 testing
SQL syntax:
mysql> load data local infile 'c:\\sub.txt' into table m;
Query OK, 4 rows affected (0.00 sec)
Records: 4 Deleted: 0 Skipped: 0 Warnings: 0
mysql> select * from m;
+-------+-----------+
| am | name |
+-------+-----------+
|434 | menios
|30567 | dimitris
|666 | skatas
| 30123 | testing |
+-------+-----------+
4 rows in set (0.00 sec)
Why is that happening?
- my PC: MySQL last version (5. ..), win32
- It works fine under linux!
'Describe' of m table
mysql> describe m
-> ;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| am | int(11) | YES | | NULL | |
| name | varchar(10) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
Tnx