|
|
|
|
![]() ![]() |
Aug 28 2005, 07:24 PM
Post
#1
|
|
|
Member [ Level 1 ] Group: Banned Posts: 32 Joined: 28-August 05 Member No.: 8,155 |
Hi i would like to create a database but i do not know how. Could some one please show me how.
|
|
|
|
Aug 28 2005, 09:17 PM
Post
#2
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
Well lets do this a couple of ways:
ONE With a script like the below PHP script: CODE <?php //quick database create database code without forum entry //define the variables for connection to database. $database="testdb"; //give it some kind of name here (the database) $user="username"; //you need a user name to use the database server $host="localhost"; //usually localhost $password="yourpassword"; //you will need a password for the database $connection=mysql_connect($host,$user,$password) or die("Couldn't connect to server, check your username and password!"); mysql_query("CREATE DATABASE $database") or die("Couldn't execute query"); echo "Database $database has just been created for you!"; ?> If you copy the above code even with the comments and assign the proper values for the host, databasename, username, and password it will connect to the database and create a database named testdb. Now let try method TWO Go to the cPanel like below Then after you click the MySQL Icon you will see this: ![]() So there you go how to create a data base with or without a cPanel using script and without using a script by using the cPanel, the choice is yours. |
|
|
|
Aug 29 2005, 10:24 AM
Post
#3
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 4 Joined: 13-July 05 Member No.: 7,076 |
QUOTE(sPyfReEsTyLe @ Aug 28 2005, 02:24 PM) Very nice script...I say the same thing... MySql is a free and very easy to use, easy to understand web-based database. The latest version is very user friendly, and you can even export your data as excel, edit it, and reinsert it into the database very easily, if you are more comfortable using that format. It is very well documented and I believe it has a support forum community as well. However, you'd need to know how to code it, write queries. My overall suggestion to you is this. Search tHotscripts.com, sourceforge.net, etc. for a free script that does what you need your database to do (like drive an address book, website, customer database, blah blah). Basically, search for a PHP script and download it. And if you can spend a few bucks (between 20USD and up), you can find commercial scripts which tend to be much better written, efficient and visually appealing. This will give you a front-end to display your data and work with the database, possibly even an admin side so that even the most inexperienced computer user can use the software. |
|
|
|
Sep 16 2005, 12:10 PM
Post
#4
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 2 Joined: 16-September 05 Member No.: 8,500 |
how about adding attributes into the database? What script can I use?
|
|
|
|
Sep 18 2005, 01:02 AM
Post
#5
|
|
|
Member [ Level 1 ] Group: Members Posts: 31 Joined: 18-September 05 Member No.: 8,536 |
like what kind of atributes? if you want to add a table (where you store info) do this:
CODE $query=" CREATE TABLE `[table name]` ( `[column name]` [data type] , ); "; mysql_query($query); for instance: CODE $query=" CREATE TABLE `contacts` ( `name` VARCHAR( 20 ) `phone number` VARCHAR( 20 ) ); "; mysql_query($query); |
|
|
|
Nov 13 2005, 09:42 PM
Post
#6
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
Your database is mostly an area where you are going to store cata that will change over time and need frequent updates or even new data altogether, but in order for it to be of any value it must have as little a one table that contains some sort of structure.
Take for example you want a database that holds all your household items with serial numer if they have such , a description of the itms, other attributes of the item such as cose, or its appraised value and so on and this database has all this stuff so in the event that you have a disaster or theft you can bring up the information and let the insurance company and police (if it were a theft or robbery. You would need a table that had such fields as item, color, description, phptograph if any, serial number if any, cost or value, and so on. So you have tables for each of these and the data type needs to be defined within the table. So you name a database lets say mystuff (use the SQL query CREATE DATABASE 'mystuff' ), then it would have a table which you use to store your stuff kinda like: CREATE TABLE 'inventory' ( 'itemNumber' INT (4) AUTO_INCREMENT, 'item' VARCHAR (40) NOT NULL, 'value' VARCHAR (15), 'color' VARCHAR (10) , 'description' VARCHAR (255), 'serialnumber' VARCHAR(50), 'date_aquired' DATE, PRIMARY KEY (itemNumber)) of course this is just a made up example but I thinkyou should be able to get the idea, your real database might have hundreds of tables, but you need to figure out what all you want in a database and then set them all up, you might want to try a search for MySQL tutorials or SQL tutorials and learn a little about just what you want a database to do for your circumstances. |
|
|
|
Nov 15 2005, 12:21 AM
Post
#7
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 16 Joined: 15-November 05 Member No.: 9,625 |
To make a database you need a ftp. After you have a ftp please look for the install. Open the install and fill in the required info. After you do that start the database and see if it is working. If it is not working then please post for further help. This works for appace and if you need help with something else PLEASE tell me right away I am really good with this.
|
|
|
|
Nov 15 2005, 07:57 PM
Post
#8
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
QUOTE(lecius @ Nov 15 2005, 07:21 AM) To make a database you need a ftp. After you have a ftp please look for the install. Open the install and fill in the required info. After you do that start the database and see if it is working. If it is not working then please post for further help. This works for appace and if you need help with something else PLEASE tell me right away I am really good with this. That's not true - FTP doesn't have anything to do with the database, unless you're uploading the actual mysql binaries to your account for upgrades. To create a database, phpMyAdmin is sufficient, or if you're a power user - you have to use the command-line client of MySQL from your shell. Once again, whether it's apache or some other httpd, I've never heard of FTP being used to create databases... That's certainly a first. Try not to spread around disinformation like this. |
|
|
|
Nov 16 2005, 02:44 AM
Post
#9
|
|
|
Techno-Necromancer Group: Members Posts: 1,018 Joined: 13-January 05 From: The Net Member No.: 2,127 |
i've noticed that at least for me, phpmyadmin cannot create new databases, I have to use the other MYSQL script in cpanel. However, if I made a database and dropped it, phpmyadmin can recreate it. Dunno why, or if this is an issue for anyone, but it's slightly annoying to me.
~Viz |
|
|
|
Jan 2 2006, 04:04 AM
Post
#10
|
|
|
Member [ Level 1 ] Group: Members Posts: 44 Joined: 2-January 06 Member No.: 10,423 |
I thought I could add something positive here, but you guys got me beat, hands down!
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 02:53 AM |