mysql 5.1的中文支持的一个改进,从mysql 4.1开始不支持中文路径,文件名的问题解决了。
见下面示例
microsoft windows xp [版本 5.1.2600]
(c) 版权所有 1985-2001 microsoft corp.
c:/documents and settings/administrator>runas /user:aaa cmd
输入 aaa 的密码:
试图将 cmd 作为用户 "my-tomato/aaa" 启动...
c:/documents and settings/administrator>cd /mysql51/bin
c:/mysql51/bin>mysql -u root
welcome to the mysql monitor. commands end with ; or /g.
your mysql connection id is 1 to server version: 5.1.7-beta-community
type 'help;' or '/h' for help. type '/c' to clear the buffer.
mysql> use test
database changed
mysql> show tables;
+----------------+
| tables_in_test |
+----------------+
| tr |
| trb3 |
+----------------+
2 rows in set (0.00 sec)
mysql> desc tr;
+-----------+-------------+------+-----+---------+-------+
| field | type | null | key | default | extra |
+-----------+-------------+------+-----+---------+-------+
| id | int(11) | yes | | null | |
| name | varchar(50) | yes | | null | |
| purchased | date | yes | | null | |
+-----------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
mysql> insert into tr (id,name) values(1,'ewr'),(2,'sr'),(3,'gh');
query ok, 3 rows affected (0.00 sec)
records: 3 duplicates: 0 warnings: 0
mysql> select * from tr into outfile 'c:/mysql51/猪八戒.txt';
query ok, 11 rows affected (0.00 sec)
mysql> select * from tr into outfile 'c:/mysql51/新建文件夹/猪八戒.txt';
query ok, 11 rows affected (0.02 sec)
mysql> create table tr2 as select * from tr limit 0;
query ok, 0 rows affected (0.06 sec)
records: 0 duplicates: 0 warnings: 0
mysql> select * from tr2;
empty set (0.00 sec)
mysql> load data infile 'c:/mysql51/新建文件夹/猪八戒.txt' into table tr2;
query ok, 11 rows affected (0.00 sec)
records: 11 deleted: 0 skipped: 0 warnings: 0
mysql>
c:/mysql51/bin>mysqladmin -u root shutdown
c:/mysql51/bin>cd /mysql50/bin
c:/mysql50/bin>mysql -u root
welcome to the mysql monitor. commands end with ; or /g.
your mysql connection id is 1 to server version: 5.0.18
type 'help;' or '/h' for help. type '/c' to clear the buffer.
mysql> use test
database changed
mysql> create table tr (id int, name varchar(50), purchased date)
-> ;
query ok, 0 rows affected (0.05 sec)
mysql> load data infile 'c:/mysql51/新建文件夹/猪八戒.txt' into table tr;
error 29 (hy000): file 'c:/mysql51/脨脗陆篓脦脛录镁录脨/脰铆掳脣陆盲.txt' not fo
und (errcode: 2)
mysql>
新闻热点
疑难解答