Page 1 of 1
creating a database file..
Posted: Tue Nov 11, 2003 6:53 am
by gavinbsocom
I'm unsure on how to create a database file? I have been reading different tutorials and I just dont understand it. I have mysql installed on my computer and I will also have it on my web hosting service in about a week. The main purpose of this is database is to make a user login / register. So do I open up a blank page in notepad and call it database1.db?
Posted: Tue Nov 11, 2003 7:09 am
by vigge89
try googling for PHPMyAdmin, which can be used for Database manipulation, creation, deletion etc..
Re: creating a database file..
Posted: Tue Nov 11, 2003 10:29 am
by JAM
gavinbsocom wrote:I'm unsure on how to create a database file?
...
So do I open up a blank page in notepad and call it database1.db?
Forgive me if I do not quite understand the issue, but what exactly do you mean by 'database file'?
Posted: Tue Nov 11, 2003 4:50 pm
by gavinbsocom
I'm trying to say a file or a database file or a database that will hold a user name and password...I just dont understand how to create one or what do I do to get one?
Posted: Tue Nov 11, 2003 5:26 pm
by infolock
ok, go in your mysql directory, and then go into the DOCS directory within it. you will see a MySQL manual. Skip down to section 3.1 and it teaches you how to use mysql from there.
if you are wanting to know how to create a database from within php on the fly, that is a totally different subject.
Posted: Tue Nov 11, 2003 7:39 pm
by gavinbsocom
so I create the database and then have php install it? Infolock your saying I could create the database from php code but it would be easier to create the database and then have the php code call the database?
Posted: Tue Nov 11, 2003 7:57 pm
by infolock
so I create the database and then have php install it? Infolock your saying I could create the database from php code but it would be easier to create the database and then have the php code call the database?
well, the easiest way possible is to just create teh database from within MySQL itself. As i said, there is a manual inside the MySQL directory that you installed it to that tells you pretty indepthly how to do this.
as far as calling the database, php is by far the easiest way. check this link out :
http://www.php.net/function.mysql-connect
it gives you some very nice functions and methods of how to connect. as far as creating the user authentication program, you may want to hold off on doing that until you learn how to create databases/tables with mysql, and then learn how to pull that info from mysql.
after you will need to learn about $_POST as i'm sure you will be typing the username/password in a post field. give me a few and i'll post a sample script i wrote a few months(maybe a year?) ago and it may give you a pretty good insight.
here's the link :
viewtopic.php?t=3649&highlight=
Posted: Tue Nov 11, 2003 9:54 pm
by gavinbsocom
Ok, but check this out,,,this isf romt he manual...this is what i dont understand....
To connect to the server, you'll usually need to provide a MySQL user name when you invoke mysql and, most likely, a password. If the server runs on a machine other than the one where you log in, you'll also need to specify a hostname. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Once you know the proper parameters, you should be able to connect like this:
shell> mysql -h host -u user -p
Enter password: ********
Where do i type that shell statement or w/e it is? In notepad? in command prompt? in what?
Posted: Wed Nov 12, 2003 4:32 am
by twigletmac
Posted: Wed Nov 12, 2003 6:12 am
by gavinbsocom
Yes, I am running windows Xp pro. Ill give that a whirl and let you know how it worked out.
Posted: Sat Nov 15, 2003 6:44 pm
by infolock
Like I said, if you would read the manual that's found in your MySQL directory, you would be able to do this so much easier
i'm not trying to be rude, but that manual gives you STEP BY STEP instructions on how to do the things you need.
but if you need a quicker response, here :
1) Clicks Start
2) Click Run
3) type CMD and press enter
4) type cd \ and press enter. this will take you to the root of C:\
5) type cd mysql
6) type cd bin
7) type mysql -u root
now, this will just get you into mysql. you are going ot need to setup another username that will ONLY have read/write/create/drop options on particular databases or tables.
all this is covered in the manual that's in your mysql/doc directory
if you want more information on function calling from within php, i suggest you read the link i posted above for calling convensions
hope that helps
