# Sql - can't connect \[noob\]

**URL:** <https://forum.kirupa.com/t/sql-cant-connect-noob/222339>\
**Category:** Uncategorized\
**Created:** [April 12, 2007, 4:14pm UTC](https://forum.kirupa.com/t/sql-cant-connect-noob/222339 "2007-04-12T16:14:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hroth](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@hroth](https://forum.kirupa.com/u/hroth)\
**Post date:** [April 12, 2007, 4:14pm UTC](https://forum.kirupa.com/t/sql-cant-connect-noob/222339/1 "2007-04-12T16:14:40Z")

</div>

Hi everyone,

I’m following the tutorial [COLOR=sienna][“Login Using Flash MX, PHP, and MySQL”](http://www.kirupa.com/developer/actionscript/authentication.htm)[/COLOR]  
It’s giving me this error: [COLOR=sienna]“Unable to connect to SQL server”[/COLOR]

the error logs on the server are saying: [COLOR=sienna]"Unknown MySQL server host "[/COLOR]  
so I must be typing something in wrong.

when I created the db, I named it, let’s say… “dbname”  
however the CP displays the database name and username as “thingey\_dbname”  
it added text in front with an underscore. Naturally I’ve tried that as my database name and username, no sucess.

here is pretty much what I have for the part drawing the error:

```auto
mysql_connect("dbname.mywebsite.com","theusername","password")
or die("Unable to connect to SQL server");
mysql_select_db("dbname") or die("Unable to select database");

```

I’ve tried:

```auto
mysql_connect("thingey_dbname.mywebsite.com","thingey_theusername","password")
or die("Unable to connect to SQL server");
mysql_select_db("thingey_dbname") or die("Unable to select database");

```

also:

[sql.mywebsite.com](http://sql.mywebsite.com)  
[mysql.mywebsite.com](http://mysql.mywebsite.com)

anyone know what I’m doing wrong here?

-hroth
