You can test the value beforehand with:
SELECT @@max_connections;
That will show you the actual value (default is usually 151). Then run:
SET GLOBAL max_connections = 1024;
If the previous command doesn't work you should see some kind of error. Anyway, just test it with the SELECT as I showed you before and if it turned into 1024 it has been increased. Otherwise, it hasn't :)
If it hasn't, it is likely that your user doesn't have enough privileges to perform that operation. That means, as I said in my answer, you'll have to contact your hosting provider