Unable to connect to database: Access denied for user ''@'localhost' to database 'socialdb'

后端 未结 6 1188
野趣味
野趣味 2021-01-21 11:07

I\'ve seen a few errors like this, but I found no answer.

Unable to connect to database: Access denied for user \'\'@\'localhost\' to database \'socialdb\'
         


        
6条回答
  •  庸人自扰
    2021-01-21 12:08

    The error is pretty self-explanatory, you're not allowed to connect without specifying some credentials.

    Change your call to mysql_connect() to something like this:

    mysql_connect("localhost", "user", "password");
    

提交回复
热议问题