September 3rd, 2013, 06:14 PM
MySQL command line output to csv from remote
Hi - I am trying to get the following command line to run on my Mac using the Mac's Terminal.app:
mysql -uuser_id –ppassword database_name -B -e "select * from table_name;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > mysql_exported_table.csv
I get the following error: - bash mysql: command not found
MySQL is installed on a remote server. My Mac is running OS X. I have MySQL Workbench installed which is how I access the remote server. I do not have any other MySQL software installed on my Mac.
Do I need any MySQL software installed locally?
Thanks - John
September 4th, 2013, 04:29 AM
Yes, the first mysql in your line is the mysql client software that needs to be installed locally.