-3
I’m doing this:
$conexao = mysql_connect($servidor, $usuario, $senha, $db);
if (!$conexao) {
die('Não conectou: '.mysql_error());
}
echo "Conectou";
And the error message is this:
Connecting to 3.22, 3.23 & 4.0 Servers is not supported.
I can’t change Mysql Server, there’s something I can do to connect?
I believe that PDO connects with mysql version 4, but only by testing https://www.php.net/manual/en/pdo.connections.php -- confirms me if this is it.
– Guilherme Nascimento
I tried with PDO and the following error appears: SQLSTATE[HY000] [2054] Connecting to 3.22, 3.23 & 4.0 Servers is not supported
– Teixeira
Dear Teixeira, I believe that only using a separate technology, for example mysql via line command + o
exec()
of PHP. Perhaps I formulate an answer or example and post again here, but apart from that I believe it will be impossible without using something from third parties, at least from third parties so far I have not found anything that is good, I even found a code, but it is terrible, full of problems, that is exec+mysqlcli, But it doesn’t pay and I feel responsible to post only good or reasonable things, things with a lot of problems would be irresponsible on my part. As soon as possible I will see this.– Guilherme Nascimento
Thanks anyway. I’m not allowed to update the server, but I have to make some modifications to the site. These modifications are simple, but setting up a server to test before you go online is giving me a headache.
– Teixeira
I found some cases on google that solved using
mysqli_connect
instead ofmysql_connect
.– Benilson
Unfortunately it gives the same error.
– Teixeira
@Benilson I believe it was something else, it must not have been exactly because of the mysqli or the PDO, it must have been a matter of version and driver, but neither I will enter this merit and nor is it useful to kick alternatives without knowing if they are effective, after all we are not technical support, we have to look for what is right for the author and future visitors... Dear Teixeira I did not suggest changing anything on the server, I suggested an idea of PHP script even if it uses mysql per command line and this is usually already standard in the hosts, so q have a time step here to talk better.
– Guilherme Nascimento
@Guilhermenascimento most situations can be tested by the person who tries to help, but Teixeira has a higher degree of complexity, for most of the OS users, it is not possible to simulate the problem he is having. In order to help, we can only conjecture based on some knowledge or research, or do nothing. For example now I would suggest that he try to use a connection
ODBC
, by using generic drives to access the database, but I have no way to say it will work.– Benilson
@Benilson this there is what we call Helpdesk, usually the question in this scenario is closed, but anyway I’m just trying to give a help to him, the rest I said was superficial, may or may not help future people, but it will depend on the "solution", if there is anything q is at least decent to solve, anyway mysqli will not solve the case, because the driver is not compatible nor in different Apis.
– Guilherme Nascimento