As you have written it, I suspect the equation has no easy solution.
But I think you mean dy/dx = (x-2)/y2 and you should have used parentheses as I did to make absolutely clear what you mean.
If I am correct in my thinking about what you mean, then variables are separable and your solution will have 2 easy integrations and I constant.