MySQL Information

From Free Hosting Wiki
(Difference between revisions)
Jump to: navigation, search
[unchecked revision][quality revision]
(Created page with "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 ...")
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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).
+
With most web scripts, any data created when handling a page request is discarded when the script finishes. To be useful, scripts of consequence need persistant data storage. This usually means interacting with a database management system, such as MySQL.
 +
 
 +
Before being able to use MySQL, you should [[How to Create a MySQL Database and User|create a MySQL database and user]] through cPanel.
 
Then you need to configure your script to connect to MySQL, the following settings should be used:
 
Then you need to configure your script to connect to MySQL, the following settings should be used:
* Host/Server Name = 'localhost'
+
;Host/Server Name
* Port = '3306'
+
: '''localhost'''
* Username = [Your cPanel username followed by an underscore and the MySQL username you configured in cPanel]
+
;Port
* Password = [The password that you used when creating the MySQL user]
+
: '''3306''' (not necessary)
* Database = [ Your cPanel username followed by an underscore and the name of the database that you created in cPanel]
+
;Username
 
+
: Your cPanel username followed by an underscore and the MySQL username you configured in cPanel.
 
+
;Password
Free hosting accounts do not have remote MySQL access.
+
: 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.
  
 +
'''''Remember:'' Free hosting accounts do not have remote MySQL access.'''
  
 
[[Category:KB]]
 
[[Category:KB]]

Latest revision as of 22:59, 30 January 2011

With most web scripts, any data created when handling a page request is discarded when the script finishes. To be useful, scripts of consequence need persistant data storage. This usually means interacting with a database management system, such as MySQL.

Before being able to use MySQL, you should create a MySQL database and user through cPanel. Then you need to configure your script to connect to MySQL, the following settings should be used:

Host/Server Name
localhost
Port
3306 (not necessary)
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.

Remember: Free hosting accounts do not have remote MySQL access.

Personal tools
Namespaces

Variants
Actions