I´m trying to solve a problem that goes as follows:
Find the equation of the cylinder circumscribed to the sphere $$x^2+y^2+z^2-2x+4y+2z-3=0$$ with generatrix parallel to the line: $$x=2t-7, y=-t+7, z=-2t+5.$$
I´ve tried using the identity for a circular cylinder with axis: $$x=\alpha t, y=\beta t, z=\gamma t$$ that gives the equation of the cylinder with radius $R:$ $$x^2+y^2+z^2-R^2= \frac{(\alpha x+\beta y+ \gamma z)^2}{\alpha ^2 +\beta ^2 + \gamma ^2}.$$ To try and use this, I´ve changed the coordinates in such way that the center of the sphere is the origin, which means that the axis of the cylinder will be of the wanted form and then I can just substitute values and then substitute my original coordinates, which gives me: $$(x-1)^2 +(y+2)^2+ (z+1)^2-9= \frac{\left(2(x-1) -(y+2) -2(z+1)\right)^2}{9}$$
Graphing that doesn´t give me the desired cylinder.
In which part of my reasoning did I commit a mistake?

Note that the equation of the sphere is $(x-1)^2 + (y+2)^2 + (z+1)^2 = 9$, which has radius $3$ and centre $(1,-2,-1)$. The axis of the cylinder must pass through the centre, and must have radius $3$, and height $6$. Try translating the sphere such that the centre coincides with the origin, and using a rotation matrix to force the axis to be the $z$-axis; compute the equation which is now fairly straightforward, and rotate back.