If password that includes special characters (like !,@,~...) is not accepted, most probably is your password handling code that blocking them.
Hello mysql_connect() does not care about the password, please post the error description that your site returns.