Re: can't import

2008-02-23 Thread Thufir
On Mon, 16 Apr 2007 10:28:30 +1000, Chris wrote:


 What did *you* do differently this time?
 
 Obviously the user is different, but what about permissions? What were
 they before? 644 should have worked previously but since we don't know
 what they were before we can't tell you.
 
 It has nothing to do with the mysql password or the spaces in the file.


I changed the SQL syntax, but will test it further as I'm getting back 
into MySQL :)


-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-15 Thread Chris



Now, would someone please explain *why* this worked and all my other attempts
didn't?  Was it because of file permissions?  or the linux user id?  or that I
put a passwork on the mysql root account? or that I changed the ownership of the
data file?  or that I took out some spaces on the data file?  Or, ... ?


What did *you* do differently this time?

Obviously the user is different, but what about permissions? What were 
they before? 644 should have worked previously but since we don't know 
what they were before we can't tell you.


It has nothing to do with the mysql password or the spaces in the file.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-13 Thread Thufir
Mogens Melander mogens at fumlersoft.dk writes:

 
 Hmmm, your LINES TERMINATED BY '/r/n';
 
 should be:
 
 LINES TERMINATED BY '\r\n';
 
 if the abc.txt file was generated on windows. If it
 was made on *nix/linux, it should be:
 
 LINES TERMINATED BY '\n';

I think I fixed it, at least as best I could.  still same result:

[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ su - mysql
Password: 
-bash-3.1$ 
-bash-3.1$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 5.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql SHOW DATABASES;
++
| Database   |
++
| information_schema | 
| alpha  | 
| bravo  | 
| charlie| 
| delta  | 
| mysql  | 
| test   | 
++
7 rows in set (0.40 sec)

mysql USE delta;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql SHOW TABLES;
+-+
| Tables_in_delta |
+-+
| abc | 
+-+
1 row in set (0.00 sec)

mysql DESCRIBE abc;
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| a | text | NO   | | |   | 
| b | text | NO   | | |   | 
| c | text | NO   | | |   | 
+---+--+--+-+-+---+
3 rows in set (0.37 sec)

mysql LOAD DATA INFILE '/tmp/abc.txt' INTO TABLE delta.abc FIELDS TERMINATED BY
',' LINES TERMINATED BY '\n';
ERROR 13 (HY000): Can't get stat of '/tmp/abc.txt' (Errcode: 13)
mysql ;
ERROR: 
No query specified

mysql quit
Bye
-bash-3.1$ exit
logout
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ cat /tmp/abc.txt -n
 1  A1, B1, C1
 2  A2, B2, C2
 3  A3, B3, C3
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ cat /tmp/abc.txt
A1, B1, C1
A2, B2, C2
A3, B3, C3
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ ll /tmp/abc.txt 
-rw-r--r-- 1 thufir thufir 33 Apr 12 06:59 /tmp/abc.txt
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ date
Fri Apr 13 08:33:44 BST 2007
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 



thanks,

Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-13 Thread Chris



I think I fixed it, at least as best I could.  still same result:

[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ su - mysql
Password: 
-bash-3.1$ 
-bash-3.1$ mysql -u root -p


snip


mysql quit
Bye
-bash-3.1$ exit
logout


No no no.

AS the MYSQL user:

cat /tmp/abc.txt

So:

su - mysql
(type in password)
cat /tmp/abc.txt

What happens?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-13 Thread Mogens Melander
Hmmm, i got a somewhat different result :^)

(BTW. I'm on Slackware 10.0. What are you on?)

$ cat /tmp/abc.txt
A1, B1, C1
A2, B2, C2
A3, B3, C3

$mysql test
Server version: 5.0.24a-log

mysql SHOW GRANTS FOR ''@localhost;
+--+
| Grants for @localhost|
+--+
| GRANT USAGE ON *.* TO ''@'localhost' |
+--+
1 row in set (0.00 sec)

mysql show tables;
++
| Tables_in_test |
++
| abc|
++
1 row in set (0.00 sec)

mysql describe abc;
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| a | text | NO   | | |   |
| b | text | NO   | | |   |
| c | text | NO   | | |   |
+---+--+--+-+-+---+
3 rows in set (0.00 sec)

mysql LOAD DATA INFILE '/tmp/abc.txt' INTO TABLE test.abc
- FIELDS TERMINATED BY ','
- LINES TERMINATED BY '\n';
Query OK, 3 rows affected (0.02 sec)
Records: 3  Deleted: 0  Skipped: 0  Warnings: 0

mysql select * from abc;
++-+-+
| a  | b   | c   |
++-+-+
| A1 |  B1 |  C1 |
| A2 |  B2 |  C2 |
| A3 |  B3 |  C3 |
++-+-+
3 rows in set (0.00 sec)

-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224


On Fri, April 13, 2007 09:39, Thufir wrote:
 Mogens Melander mogens at fumlersoft.dk writes:


 Hmmm, your LINES TERMINATED BY '/r/n';

 should be:

 LINES TERMINATED BY '\r\n';

 if the abc.txt file was generated on windows. If it
 was made on *nix/linux, it should be:

 LINES TERMINATED BY '\n';

 I think I fixed it, at least as best I could.  still same result:

 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ su - mysql
 Password:
 -bash-3.1$
 -bash-3.1$ mysql -u root -p
 Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 18 to server version: 5.0.27

 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 mysql SHOW DATABASES;
 ++
 | Database   |
 ++
 | information_schema |
 | alpha  |
 | bravo  |
 | charlie|
 | delta  |
 | mysql  |
 | test   |
 ++
 7 rows in set (0.40 sec)

 mysql USE delta;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A

 Database changed
 mysql SHOW TABLES;
 +-+
 | Tables_in_delta |
 +-+
 | abc |
 +-+
 1 row in set (0.00 sec)

 mysql DESCRIBE abc;
 +---+--+--+-+-+---+
 | Field | Type | Null | Key | Default | Extra |
 +---+--+--+-+-+---+
 | a | text | NO   | | |   |
 | b | text | NO   | | |   |
 | c | text | NO   | | |   |
 +---+--+--+-+-+---+
 3 rows in set (0.37 sec)

 mysql LOAD DATA INFILE '/tmp/abc.txt' INTO TABLE delta.abc FIELDS
 TERMINATED BY
 ',' LINES TERMINATED BY '\n';
 ERROR 13 (HY000): Can't get stat of '/tmp/abc.txt' (Errcode: 13)
 mysql ;
 ERROR:
 No query specified

 mysql quit
 Bye
 -bash-3.1$ exit
 logout
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ cat /tmp/abc.txt -n
  1  A1, B1, C1
  2  A2, B2, C2
  3  A3, B3, C3
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ cat /tmp/abc.txt
 A1, B1, C1
 A2, B2, C2
 A3, B3, C3
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ ll /tmp/abc.txt
 -rw-r--r-- 1 thufir thufir 33 Apr 12 06:59 /tmp/abc.txt
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ date
 Fri Apr 13 08:33:44 BST 2007
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$



 thanks,

 Thufir


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


 --
 This message has been scanned for viruses and
 dangerous content by OpenProtect(http://www.openprotect.com), and is
 believed to be clean.




-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-13 Thread Thufir
I think I got it:


pasty / paste.husk.org

This content is stored as http://paste.husk.org/8089.

From: Someone at 24.84.131.197
Summary: -bash-3.1$ -bash-3.1$ -bash-3.

-bash-3.1$ 
-bash-3.1$ 
-bash-3.1$ whoami
mysql
-bash-3.1$ ls -al /tmp/abc.txt 
-rw-r--r-- 1 mysql mysql 27 Apr 13 11:36 /tmp/abc.txt
-bash-3.1$ cat /tmp/abc.txt 
A1,B1,C1
A2,B2,C2
A3,B3,C3
-bash-3.1$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 5.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql SHOW DATABASES;
++
| Database   |
++
| information_schema | 
| alpha  | 
| bravo  | 
| charlie| 
| delta  | 
| mysql  | 
| test   | 
++
7 rows in set (0.09 sec)

mysql USE delta;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql SHOW TABLES;
+-+
| Tables_in_delta |
+-+
| abc | 
+-+
1 row in set (0.00 sec)

mysql DESCRIBE abc;
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| a | text | NO   | | |   | 
| b | text | NO   | | |   | 
| c | text | NO   | | |   | 
+---+--+--+-+-+---+
3 rows in set (0.04 sec)

mysql LOAD DATA INFILE '/tmp/abc.txt' INTO TABLE delta.abc FIELDS TERMINATED BY
',' LINES TERMINATED BY '\n';
Query OK, 3 rows affected (0.06 sec)
Records: 3  Deleted: 0  Skipped: 0  Warnings: 0

mysql SELECT * FROM delta.abc;
++++
| a  | b  | c  |
++++
| A1 | B1 | C1 | 
| A2 | B2 | C2 | 
| A3 | B3 | C3 | 
++++
3 rows in set (0.03 sec)

mysql quit
Bye
-bash-3.1$ 
-bash-3.1$ date
Fri Apr 13 11:40:41 BST 2007
-bash-3.1$ 
-bash-3.1$ 
-bash-3.1$ 


Now, would someone please explain *why* this worked and all my other attempts
didn't?  Was it because of file permissions?  or the linux user id?  or that I
put a passwork on the mysql root account? or that I changed the ownership of the
data file?  or that I took out some spaces on the data file?  Or, ... ?


-Thufir


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-12 Thread Chris

Thufir wrote:

I'm at total loss.  apparently, error 13 relates to file permissions?  what
could possibly be preventing the import?


Change to the mysql user (you might have to go to root and then mysql):

# su - mysql

then try it:

cat /tmp/abc.txt

what happens?



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import

2007-04-12 Thread Mogens Melander
Hmmm, your LINES TERMINATED BY '/r/n';

should be:

LINES TERMINATED BY '\r\n';

if the abc.txt file was generated on windows. If it
was made on *nix/linux, it should be:

LINES TERMINATED BY '\n';

-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224


On Thu, April 12, 2007 09:58, Thufir wrote:
 I'm at total loss.  apparently, error 13 relates to file permissions?
 what
 could possibly be preventing the import?

 http://paste.husk.org/8073 for:

 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$ ll /tmp/abc.txt
 -rw-r--r-- 1 thufir thufir 33 Apr 12 06:59 /tmp/abc.txt
 [EMAIL PROTECTED] ~]$ cat /tmp/abc.txt
 A1, B1, C1
 A2, B2, C2
 A3, B3, C3
 [EMAIL PROTECTED] ~]$ mysql -u root
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 5 to server version: 5.0.27

 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 mysql show databases;
 ++
 | Database   |
 ++
 | information_schema |
 | alpha  |
 | bravo  |
 | charlie|
 | delta  |
 | mysql  |
 | test   |
 ++
 7 rows in set (0.09 sec)

 mysql use delta;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A

 Database changed
 mysql show tables;
 +-+
 | Tables_in_delta |
 +-+
 | abc |
 +-+
 1 row in set (0.00 sec)

 mysql describe abc;
 +---+--+--+-+-+---+
 | Field | Type | Null | Key | Default | Extra |
 +---+--+--+-+-+---+
 | a | text | NO   | | |   |
 | b | text | NO   | | |   |
 | c | text | NO   | | |   |
 +---+--+--+-+-+---+
 3 rows in set (0.00 sec)

 mysql LOAD DATA INFILE '/tmp/abc.txt' INTO TABLE delta.abc FIELDS
 TERMINATED BY
 ',' LINES TERMINATED BY '/r/n';
 ERROR 13 (HY000): Can't get stat of '/tmp/abc.txt' (Errcode: 13)
 mysql exit
 Bye
 [EMAIL PROTECTED] ~]$ date
 Thu Apr 12 08:53:37 BST 2007
 [EMAIL PROTECTED] ~]$
 [EMAIL PROTECTED] ~]$

 (I've even tried it as root, same result.  this implies to me that the
 source of
 the message is with mysql rather than linux per se.)



 thanks,

 Thufir



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


 --
 This message has been scanned for viruses and
 dangerous content by OpenProtect(http://www.openprotect.com), and is
 believed to be clean.




-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import sql using databasewhatever.sql

2003-10-13 Thread Victoria Reznichenko
Victor Sp?ng Arthursson [EMAIL PROTECTED] wrote:
 Hi!
 
 I'm having a strange problem - I can't read data using the
 
mysql -u root -p databasepath/to/whatever.sql
 
 Not getting any error message, but some kind of introduction text 
 flashes by reading:
 
 
 [powerbook:~] victor% /usr/local/mysql/bin/mysql -u root -p *** databas 
  /path/to/tabell.sql

Remove space between -p option and password.

 /usr/local/mysql/bin/mysqlš Ver 12.21 Distrib 4.0.15, for 
 apple-darwin6.4 (powerpc)
 Copyright (C) 2002 MySQL AB
 This software comes with ABSOLUTELY NO WARRANTY. This is free software,
 and you are welcome to modify and redistribute it under the GPL license
 Usage: /usr/local/mysql/bin/mysql [OPTIONS] [database]
 š -?, --helpš š š š š Display this help and exit.
 š --auto-rehashš š š šEnable automatic rehashing. One doesn't need to 
 use
 
 [...  clip ...]
 
 max_allowed_packetš š š š š š š š 16777216
 net_buffer_lengthš š š š š š š š š16384
 select_limitš š š š š š š š š š š 1000
 max_join_sizeš š š š š š š š š š š100
 
 
 Anyone knowing what to do? It's pretty urgent cause I'm having this big 
 database for a project that is to big to import using phpmyadmin - 
 causes the browser to time out...
 
 Sincerely
 
 Victor
 
 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't import sql using databasewhatever.sql

2003-10-13 Thread gerald_clark
-p without the passwd immediately following is not compatible with
input redirection.
Either add the password after the -p with NO space, or better yet,
create a .my.cnf file in the home directory of the user running the script
and have it contain the user and password settings.
Victor Spång Arthursson wrote:

Hi!

I'm having a strange problem - I can't read data using the

mysql -u root -p databasepath/to/whatever.sql

Not getting any error message, but some kind of introduction text 
flashes by reading:


[powerbook:~] victor% /usr/local/mysql/bin/mysql -u root -p *** 
databas  /path/to/tabell.sql
/usr/local/mysql/bin/mysql  Ver 12.21 Distrib 4.0.15, for 
apple-darwin6.4 (powerpc)
Copyright (C) 2002 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Usage: /usr/local/mysql/bin/mysql [OPTIONS] [database]
  -?, --help  Display this help and exit.
  --auto-rehash   Enable automatic rehashing. One doesn't need to use

[...  clip ...]

max_allowed_packet16777216
net_buffer_length 16384
select_limit  1000
max_join_size 100

Anyone knowing what to do? It's pretty urgent cause I'm having this 
big database for a project that is to big to import using phpmyadmin - 
causes the browser to time out...

Sincerely

Victor




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Can't import dump file OS X

2001-12-11 Thread ollie

Thanks Brent,

Yes, I too can import with LOAD DATA and mysqlimport, but the thing that's
irritating is that I have to create the tables first in order to import the
data in either case.

With a 'regular' import from a dumped table, mysql should be able to read
the SQL statements within the dump file to create the table(s) AND then
populate them with the data. Job done in one hit!

I'd appreciate if you could try this on your system and let me know how you
get on!



 I've successfully imported a very small dataset (about 10k records) into
 MySQL under OSX. I'm just getting started in MySQL, so I'm afraid I don't
 have much to offer except to say it can be done.
 
 I'm not sure what syntax you are using in your example. All examples I've
 seen use the LOAD DATA ... INFILE ... INTO TABLE ... command to get a text
 file into a database. The alternative is to use the mysqlimport utility if
 everything that is needed is contained in the text file.
 
 Perhaps that points you in the right direction???


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php