MySQL connection

Status
Not open for further replies.

abhinav2

New Member
Messages
2
Reaction score
0
Points
1
Hi,
I have setup an account on x-10 hosting recently.
I have setup a database and also some tables in that database using phpMyAdmin.
Now I want to access the database using a php script.
So I would require three things, Host, user_name and password.
I searched everywhere but I couldn't find them .i.e I couldn't find MySQL authentication on my CPanel.
How do I find the above mentioned credentials db-host, username and password?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Host name is "localhost"

Username/password:
cPanel -> Databases panel -> MySQL Databases
MySQL Users - Add New User
Create a new user/password -- note that the username will be your-cPanel-username_something , not just something
(I usually make the username the same as the database I use it for.) Write down the password.
Add user to database, checking the "ALL PRIVILEGES" box.
 

abhinav2

New Member
Messages
2
Reaction score
0
Points
1
Hi,
Thanks for the quick reply.
I was having this doubt in mind. The host name "localhost" would work only for websites hosted on the x10 server i.e. on my account of x10.
I wanted to create an android app and then access the database hosted on x10 server using the mobile app. So if I give the host name as "localhost", it wouldn't work.
Is there any way to get things work?

Thanks
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
There is no remote access to the MySQL on free hosting accounts. No exceptions.

Your app would have to contact a .php page on your site, which would have to then query the server, and then relay the answer (properly formatted) back to your app.
 

webbrosx

New Member
Messages
1
Reaction score
0
Points
1
I have been having a similar problem. I am creating a site search for my website. Every time I search something it gives me this message:
Warning: mysql_connect(): Access denied for user 'username'@'localhost' (using password: YES) in/home/username/public_html/results.php on line 32
Access denied for user 'webbrosx_search'@'localhost' (using password: YES)

How can I fix this? Would you able to write out the line of code for me please?
 
Status
Not open for further replies.
Top