mysql tmp目录权限,使MySQL服务器在\xampp\tmp文件夹中具有写权限

how can i change the privilege of the directory \xampp\tmp in Mysql Server into write

coz when i want to create and write in a csv file with the query bellow , i'm facing this error msg in mysql (Can't create/write to file '\tmp\orders.csv' (Errcode: 2))

the query :

SELECT g.id, g.name, g.date, g.date_mod, g.status, cree_par, modifier_par

FROM glpi_tickets g , (select id, concat(realname , ' ' , firstname)

cree_par from glpi_users ) c, (select id, concat(realname , ' ' ,

firstname) modifier_par from glpi_users) m

where users_id_recipient <> users_id_lastupdater

and users_id_recipient = c.id

and users_id_lastupdater = m.id

INTO OUTFILE '/tmp/orders.csv'

FIELDS TERMINATED BY ','

ENCLOSED BY '"'

LINES TERMINATED BY '\n'

thanks in advance ^^

解决方案Set writable permissions for /xampp/tmp (unix):

sudo chmod 777 /xampp/tmp

Windows:

1. Right-click the file or folder, click Properties, and then click the Security tab.

2. Click Advanced, and then click the Owner tab.

3. Click Edit, and then do one of the following:

· To change the owner to a user or group that is not listed, click Other users and groups and, in Enter the object name to select (examples), type the name of the user or group, and then click OK.

· To change the owner to a user or group that is listed, in the Change owner to box, click the new owner.

4. If you want to take ownership of the contents of the folder, select the Replace owner on sub containers and objects check box.

5. Click OK, and then click Yes when you receive the following message:

· You do not have permission to read the contents of directory folder name. Do you want to replace the directory permissions with permissions granting you Full Control?

· All permissions will be replaced if you click Yes.

Note folder name is the name of the folder that you want to take ownership of.

6. Click OK, and then reapply the permissions and security settings that you want for the folder and its contents.

Additional considerations

· An administrator can take ownership of any file on the computer.

· Assigning ownership of a file or a folder might require you to elevate your permissions using User Access Control.

Set right OUTFILE path

SELECT g.id, g.name, g.date, g.date_mod, g.status, cree_par, modifier_par

FROM glpi_tickets g , (select id, concat(realname , ' ' , firstname)

cree_par from glpi_users ) c, (select id, concat(realname , ' ' ,

firstname) modifier_par from glpi_users) m

where users_id_recipient <> users_id_lastupdater

and users_id_recipient = c.id

and users_id_lastupdater = m.id

INTO OUTFILE '/xampp/tmp/orders.csv'

FIELDS TERMINATED BY ','

ENCLOSED BY '"'

LINES TERMINATED BY '\n'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值