Q: How to convert a string into a date in a given format Need a string in '9-2-1832' format in a '1832-09-02' format.
Must be able to fill a 'date' type field in mysql.   

A: If you allow extra tooling (after all you tagged mysql) you could do it with one command from the dateutils package:
$ dateconv -i %m-%d-%Y  "9-2-1832"
1832-09-02

The difference to GNU date is that you can specify the input format using format specifiers (the -i parameter).  That way any kind of date can be parsed.
As you wanted standard ISO 8601 formatting as output (the default for all tools from the package) nothing had to be specified there.
Disclaimer: I am the author of dateutils.

A: Assuming your original date is "month-day-year" (September 2, 1832), something like this might work:
$ date -d $(sed "s/-/\//g" <<< '9-2-1832') +%Y-%m-%d
1832-09-02

Explanation
The date command, even at the current 8.25 version, won't accept a date of the format you list ('9-2-1832', a month-day-year date string with hyphens as separators).
$ date -d '9-2-1832' +%Y-%m-%d
date: invalid date '9-2-1832'

But date will accept a month-day-year date string with slashes as separators.
$ date -d '9/2/1832' +%Y-%m-%d
1832-09-02

You can use sed to swap the hyphens for slashes like so.
$ sed "s/-/\//g" <<< '9-2-1832'
9/2/1832

Then you can put the sed command in a subshell to put everything together.
$ date -d $(sed "s/-/\//g" <<< '9-2-1832') +%Y-%m-%d
1832-09-02

