Php 连接到mysql数据库:PDO过早结束数据

Php 连接到mysql数据库:PDO过早结束数据,php,mysql,pdo,connection,nette,Php,Mysql,Pdo,Connection,Nette,我有问题,当我想把网站托管。我正在使用nette,当我想连接时,我会出错 PDO::_构造():数据过早结束(mysqlnd\u wireprotocol.c:553) 我正在将nette框架与此db配置一起使用: dsn: 'mysql:host=dbhost;dbname=dbtable' user: dbuser password: dbpass 当我尝试经典连接时,它工作正常。我不知道该怎么办以及如何解决这个问题 if($myslConnection = mysql_connect("

我有问题,当我想把网站托管。我正在使用nette,当我想连接时,我会出错

PDO::_构造():数据过早结束(mysqlnd\u wireprotocol.c:553)

我正在将nette框架与此db配置一起使用:

dsn: 'mysql:host=dbhost;dbname=dbtable'
user: dbuser
password: dbpass
当我尝试经典连接时,它工作正常。我不知道该怎么办以及如何解决这个问题

if($myslConnection = mysql_connect("dbhost", "dbuser", "dbpass")){
  echo("connected");
    mysql_select_db("dbtable",$myslConnection);
    $result = mysql_query("SELECT * FROM news", $myslConnection);

    while($resultItem = MySQL_Fetch_Row($result)){
         echo $resultItem[1]."<br>";
    }
}
else{
  exit("not connected");
}

显然,这是您的特定托管公司的问题,只有他们的技术支持才能提供帮助。祝你好运。你得到的确切错误是什么?托管公司提供的到db的同步连接很少(最多5个)。因此,您可以调试代码,该代码用于在编辑中获取connecton.exact错误。我试图调用设置密码,但没有帮助。要在my.cnf中编辑标志,我必须询问我的主机提供商?问题已由提供商解决。。谢谢你的帮助
Warning: PDO::__construct() [pdo.--construct]: Premature end of data (mysqlnd_wireprotocol.c:553) in /var/www/html/unix/i/y/domainname.noveranet.cz/www/info.php on line 5

Warning: PDO::__construct() [pdo.--construct]: OK packet 1 bytes shorter than expected in /var/www/html/unix/i/y/domainname.noveranet.cz/www/info.php on line 5

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file' in /var/www/html/unix/i/y/domainname.noveranet.cz/www/info.php:5 Stack trace: #0 /var/www/html/unix/i/y/domainname.noveranet.cz/www/info.php(5): PDO->__construct('mysql:host=tran...', 'user', 'pass') #1 {main} thrown in /var/www/html/unix/i/y/domainname.noveranet.cz/www/info.php on line 5