|
|
|
|
![]() ![]() |
Apr 20 2008, 12:46 AM
Post
#1
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 20-April 08 Member No.: 29,912 |
How do you access databases?Even though i don't have a hosting account yet i want to think ahead. Please help
thx, romeo123 |
|
|
|
Apr 20 2008, 04:11 AM
Post
#2
|
|
|
Member - Active Contributor Group: [MODERATOR] Posts: 99 Joined: 8-January 08 Member No.: 27,477 |
It depends on what you want to do with them. Many people use server software packages such as MediaWiki (to make a clone of WikiPedia), or phpBB for bulletin boards. In each case, these programs use databases to store and retrieve the contents of their web pages.
As a result, they take care of using the database themselves. Usually, to set up such a program, you first need to create a database account on the server, then tell the MediaWiki or phpBB software what the userid and password are for that account. Many "free" or low-cost hosting services limit users to very few database accounts. AstaHost does not. If you really want to use one of these databases "barefoot," you need to study SQL. I really do not recommend that, as you will see here and here. If you are determined, have at it! Otherwise, find an application that is already built, and close to what you want. In Windows, look at Ms Access, Writer's Project Organizer or Album Shaper. In Linux, look at Beagle or GnuCash, which you may find more of a challenge to install. On most modern operating systems, the "database engine" understands SQL commands, but the typical user finds an application that generates the SQL commands for him. |
|
|
|
Apr 22 2008, 03:51 PM
Post
#3
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 1,886 Joined: 16-August 05 Member No.: 7,896 |
More precisely, when you are hosted at astahost (like on most of modern host offering cpanel), once you clicked in "create a database" you are asked a lot of questions about the database name and the user name, and then you are provided with the connection strings for connecting to your database. The informations are like these, they explain how to connect depending if you connect from a perl program, or from php, or from JDBC :
Connection Strings Perl $dbh = DBI->connect("DBI:mysql:myname_mydatabase:localhost","myname_mydatabase","<PASSWORD HERE>"); PHP $dbh=mysql_connect ("localhost", "myname_mydatabase", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("myname_mydatabase"); JDBC (may not be available) <%@ page import="java.sql.*" %> Connection connection = null; Class.forName("org.gjt.mm.mysql.Driver").newInstance(); connection = DriverManager.getConnection( "jdbc:mysql://localhost/myname_mydatabase?user=myname_mydatabase&password=<PASSWORD HERE>"); Of course, here at astahost, you will probably use pre-installed script. For instance the php installation and configuration scirpt will ask your for the database server (you enter "localhost"), the database name (the database name you just entered when creating the database) and the database administrator name. Hope this helped. Yordan |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th July 2008 - 07:28 AM |