Using a FQP30N06L MOSFET on a 3.3v microcontroller
Similar question: Transistor Push Pull Stage to drive Mosfet

The simplest driver would be a common emmitter NPN configuration which would invert your logic but give you the voltage gain needed to drive your FET gate. Keep in mind the high side 470 ohm resistor will almost always be conducting since your application is mostly keeping the solenoid in the "off" state, so if you go with this configuration there will always be a 24mA drain on your 12V power supply (choose the size to balance constant power drain and required turn on speed). If constant drain is unacceptable (battery powered for example), you can add another common emitter PNP stage or try to build a push-pull stage with complementary NPN/PNP trasnsistors/FETs to actively drive the FET base both directions (hard, be careful with shoot-through).

Here's the common emitter NPN driver you could start with:







simulate this circuit &ndash; Schematic created using CircuitLab

The orange plot shows the voltage across the solenoid (modeled by series resistor and inductor) which you'll notice is inverted from the 3.3V drive signal.



Alternatively, if you want to try driving the FET gate straight from your microcontroller, start with a light bulb or power resistor capable of drawing the same 2.5A current (4.8 ohm capable of handling 30W) and use at least a 165 ohm gate resistor to prevent you from exceeding the maximum source/sink GPIO pin current (assuming it's 20mA, check the datasheet).

\begin{equation}
165\Omega = \frac{3.3 V}{20 mA}
\end{equation}

The MOSFET datasheet shows the max threshold voltage for 250uA is 2.5V but looking at Figure 6: Gate Charge Characteristics, the Miller plateau is at about 4V which suggests 3.3V won't be able to fully drive the FET open for the current you require (thanks to @Chris Stratton for pointing that out)... but you could still give it a shot if the power dissipation during "on" time is manageable (it'll have a higher Ron when partially switched on).

Note on powering the relay (big inductor): if your microcontroller starts doing weird things like freezing or resetting, it may be from the electrical noise of manipulating large currents. In that case you'll need to take measures to buffer the microcontroller drive signal to protect the microcontroller pins (something like an optocoupler would work great).