how to connect mysql

Status
Not open for further replies.

susanneli

New Member
Messages
1
Reaction score
0
Points
0
I have created a databas and table. when I used this "$db = mysql_connect("localhost", "susanne@int.chopin.x10hosting.com", "121212"); to connect the database, failed. So, what's the database server name, server name and the password? How can I look through them?
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
To use MySQL in your website you will first need to create a MySQL database and a MySQL User. You can do this from cPanel. (Don't forget to link the User to your Database).

Then you need to configure your script to connect to MySQL, the following settings should be used:
• Host/Server Name = 'localhost'
• Port = '3306'
• Username = [Your*cPanel username followed by an underscore and the MySQL username you configured in cPanel]
• Password = [The password that you used when creating the MySQL user]
• Database = [ Your cPanel username followed by an underscore and the name of the database that you created in cPanel]
Free hosting accounts do not have remote MySQL access.
 
Status
Not open for further replies.
Top