I want to run this code on byethost31.com (free hosting site) so i am facing " Access denied for user 'test123'@'192.168.0.38' (using password: NO)" Error on console..<?php$localhost="*************";$pass="*************";$usename="*************";$dbname="*************";$s=mysql_connect($localhost,$pass,$username);$t=mysql_select_db($dbname);if($s ){ echo "Mysql_connect is successful. <hr>";}if($t ){ echo "Mysql_select_db is successful.. <hr>";}?>推荐答案如果您选中 mysql_connect函数的文档,您将看到它采用的参数依次为:Server,Username,Password.您以用户名而不是其他方式发送密码.If you check the documentation for the mysql_connect function, you will see that the params it takes is: Server, Username, Password in that order. You send your password in as username instead of the other way.我建议您先查看PDO或mysqli,而不要使用弃用的 mysql_* api.I would recommend that you take a look at PDO or mysqli instead of using the deprecated mysql_* api. 这篇关于用户'test123'@'192.168.0.38'的访问被拒绝(使用密码:否)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!