SELECT wp_posts.ID,
wp_posts.post_author,
wp_users.ID,
wp_users.display_name
FROM wp_posts,
wp_users
WHERE wp_posts.post_author = wp_users.ID
AND wp_users.ID != 1
這給我造成如何在SQL中導出1045錯誤時運行SQL查詢結果?
現在我想導出這個結果我從查詢在phpMyAdmin獲得。
爲此我做了這個,根據下面給出的答案。
SELECT wp_posts.ID,
wp_posts.post_author,
wp_users.ID,
wp_users.display_name
FROM wp_posts,
wp_users
WHERE wp_posts.post_author = wp_users.ID
AND wp_users.ID != 1
INTO OUTFILE 'D:\backup\export.csv'
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
它給了我錯誤
1045 - 訪問被拒絕的用戶 '用戶名' @ 'localhost' 的(使用密碼:YES)
? –
[如何將mysql查詢輸出保存爲excel或.txt文件?](http://stackoverflow.com/questions/21253704/how-to-save-mysql-query-output-to-excel-or- txt文件) –