gpt4 book ai didi

php - MySQL数据库SSL连接使用PHP

转载 作者:太空宇宙 更新时间:2023-11-03 14:19:29 25 4
gpt4 key购买 nike

我有一个非远程服务器的数据库设置。

我想做的是使用 PHP 建立连接。

服务器上的所有设置都正常,因为我使用 MySQL Workbench 使用以下详细信息对其进行了测试:主机名:xxx.xx.xx.xxx 端口 - 空白,默认为:3306

在工作台的高级选项卡中,选择了“如果可用则使用 SSL”。连接测试成功。

尽管当我尝试使用简单的 mysq_connect('IP','user','pass') 进行连接时,我收到以下错误:第 2 行:$c = mysql_connect('IP','USER','PASS');

Warning: mysql_connect() [function.mysql-connect]: Premature end ofdata (mysqlnd_wireprotocol.c:553) in C:\wamp\www\sql\index.php on line

Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected >in C:\wamp\www\sql\index.php on line 2

Warning: mysql_connect() [function.mysql-connect]: 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 C:\wamp\www\sql\index.php on line 2

我已经好几天都在尝试建立这种联系了。请帮忙!

最佳答案

尝试..

mysql_connect('IP','USER','PASS', false, MYSQL_CLIENT_SSL);

关于php - MySQL数据库SSL连接使用PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10701217/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com