Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Learn about SQL Server DBA, SQL Server database performance,SQL Server optimisation,database tuning,t-sql,ssis
Browse by Tags · View All
DBA Scripts 51
performance 37
SQL Server 29
Object Management 24
#SQLServer 24
Backup and Restore 20
Security Management 20
Powershell 17
Indexes 14
DBA 14

Archive · View All
June 2011 38
January 2011 33
May 2011 32
August 2011 27
July 2011 26
January 2012 24
February 2011 19
April 2011 19
March 2011 17
March 2012 17

Jack Vamvas's Blog

DB2 mysql export as output

Jan 21 2011 7:44AM by Jack Vamvas   

I had to export some data from a Mysql database, for the purpose of creating a spreadsheet, which would be used for presentation purposes and also to import into a DB2 database.

Initially I considered using an ODBC connection from my laptop,  I do not have ODBC drivers for mysql on my laptop. The policy of the company is to not allow new drivers installed with centralised authority.

Even without the drivers it was straightforward.

Logged into mysql and created a resultset via the following command:

Mysql>select p.page_title from page p inner join text t on p.page_latest = t.old_id and p.page_title LIKE 'db2%';

How can I get that resultset into an output file, which will be useful?

mysql> select p.page_title,t.old_text from page p inner join text t on p.page_latest = t.old_id and p.page_title LIKE 'db2%' INTO OUTFILE '/tmp/jvtest.csv';

ERROR 1045 (28000): Access denied for user 'usertemp'"'localhost' (using password: YES)

I'd seen this error before, and related to the actual Mysql user not having access to the underlying file system. Although the Linux user account Id used to log onto the Linux server, had sufficient permissions.

Under the circumstances two methods were available:

Method 1

echo @ select p.page_title,t.old_text from page p inner join text t on p.page_latest = t.old_id and p.page_title LIKE 'db2%'@ > /tmp/test

mysql> -pmypassword -umyuser wikidb < /tmp/test > /tmp/jvtest.csv

Method 2

Use tee - this will save all output from screen

Mysql > tee /tmp/output.txt

Mysql > no teee


I used method 1 as I had more scope to format .

Republished from http://www.dba-db2.com/.


Republished from SQL Server DBA [65 clicks].  Read the original version here [32134 clicks].

Jack Vamvas
5 · 27% · 8528
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]