connecting to mysql problems..

Status
Not open for further replies.

partymaker

New Member
Messages
7
Reaction score
0
Points
0
My subdomain is:www.toni.x10hosting.com
I created new user in mysql db, for connecting to "bd" from other host server.(useing PHP of course).
for exemple:new user name:wert;
password:123456

For connecting I write:
$username = "wert";
$password = "123456";
$server = "toni.x10hosting";
$mysqlconnection = mysql_connect($server, $username, $password);

Where I do mistake?
Please help!
 
T

themasterrocker

Guest
shouldn't it be toni.x10hosting.com for the server? i mean i don't know alot about mysql but that would have been one of the obvious bits :p
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
username would be {cpanelusername}_wert, password "123456", server "localhost"
So mysql_connect is like this: mysql_connect("localhost", "toni_wert", "123456");
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
The problem is your host name
Instead of
Code:
toni.x10hosting
use
Code:
localhost
Here is the code using localhost:
PHP:
$username = "wert";
$password = "123456";
$server = "localhost";
$mysqlconnection = mysql_connect($server, $username, $password);

Give that a try; I'm 100% sure it will work. :)
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
no Marshian is correct. the username should be (cpannel_name)_wert
and the host shold be toni.x10hosting.com if you are connecting from a different server which it sounds like you are trying to.
 

partymaker

New Member
Messages
7
Reaction score
0
Points
0
I'm connecting from different server.
$server = "localhost"; is not the solution for my problem!
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
As cowctcat said, if you want to connect from a remote server, the server is indeed "toni.x10hosting", and not "localhost"
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
x10Hosting does not allow user to connect to their MySQL databases from remote servers.
 

tnl2k7

Banned
Messages
3,131
Reaction score
0
Points
0
This has been resolved so I'll close it :).

-Luke.

* Thread Closed *
 
Status
Not open for further replies.
Top