Your requirement should never be an actual consideration, because you should not be storing clear text passwords in your MySQL database in the first place. Instead, you should be checking password creation in your PHP server code (as well as possibly on the front end). If valid, you should be hashing your passwords irreversibly, and then storing the hash in the user table. Your exact specified requirements can be gotten using the following regex pattern:
^.{4,}\d$
This would match 5 or more characters of any kind, the last of which is a digit. For some more ideas on a better password strength, and how to write a regex for that, consider reading the canonical SO question
Regex to validate password strength.
Edit:
Given that it appears you are using SQL Server, if you really needed a clear text password column with your requirements, you could use a check constraint:
CREATE TABLE users (
id INT NOT NULL,
password VARCHAR(100) NOT NULL,
CONSTRAINT check_password
CHECK (LEN(password) >= 5 AND RIGHT(password, 1) LIKE '[0-9]')
);