TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Unix Learnings > Running mysql queries from unix

Sourav Gulati
Site Owner
Posts: 83

Take a look at following script

#!/bin/bash

mysql -h192.168.213.19 -uroot -proot<<EOF

use information_schema;

show tables;

EOF

Here  "-h" specifies the host where mysql is running

"-u" and  "-p" specify username and password

information_schema is the database name

Note: Database should be accessible from 'user'@'host' if you are accessing it from remote host

 

 

--


January 7, 2013 at 2:35 AM Flag Quote & Reply

You must login to post.