Jump to content

Make A Database


Recommended Posts

OK, I have been having problems with databases.

 

Anyways, I just downloaded MySQL 4.0.13 thinking maybe it will have the 'test' database in it.

Well, I go to make one and the mysqladmin.exe doesn't stay open. How can I make a DB?

 

For phpBB.

Share this post


Link to post
Share on other sites

Nevermind, you're running windows mysql and I cannot help you with that since I don't know if it works the same way the linux version works.

Share this post


Link to post
Share on other sites

Are you using phpbb ? If so, you would use the phpbb admin menu and it would then let you setup a database name to use. That is about all I know. This way you don't open up mysqladmin, but you still interact with it. Hope this helps

Share this post


Link to post
Share on other sites

No dude, I need to make a database.

 

In MySQL, it comes with one that you use called 'test'. Anyways, test, isn't in it. And there are no databases with it.

 

And you have to have a database for phpBB. That is what I need to make.

Share this post


Link to post
Share on other sites

Download a GUI for the win ver of MySQL. I like LinuxProx only use the linux ver. You could install webmin. I have been playing around with it.

 

I am gonna put it on a test server with apache, mysql and php. I am going to investigate the limitations of it. I think the site is www.webmin.com or .org.

Share this post


Link to post
Share on other sites

OC16, this is exactly what I've been working on recently

 

there is a website out there for you that explains this to a T.

http://www.mysql.com/articles/ddws/10.html that link goes to an article on setting up PHP to work with MySQL but it has a great resource to get started.

 

The windows version and the Unix version are somewhat different to get started but the commands on the inside are the same. To sum up the article and create a database, do this.

 

c:\mysql\bin\mysql -h hostname -u user -p

or wherever you have that stuff installed

 

next up, do this...

mysql> create database "name of DB"; (don't use quotes)

this will create the database

 

to make a table within the database, do this...

mysql> use "name of DB";

mysql> create table "table name" (

> <1st col. name> <1st col. type> <1st col. details>,

> <2nd col. name> <2nd col. type> <2nd col. details>,

> ...

> );

 

For instance, I made a database for a project I'm working on:

mysql> create table ISBN (

> ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

> CourseID TEXT,

> CourseName TEXT,

> Professor TEXT,

> ISBNNo TEXT

> );

 

that creates a table called ISBN that has 5 columns. The ID column uses only integers, cannot be 0, automatically counts, and is the primary key for the table. the others all use text.

 

To display the contents of a table:

mysql> select * from "table name";

 

To insert data into a table: (easiest way to do it for me... there's another method in the linked site but it's a bit more confusing I think)

mysql> insert into "table name" SET

> <1st col. name> =

,

> <2nd col. name> =

,

> ...

> ;

pretty simple stuff. That will just get you started, but that website will go a little bit more into the options and has a link that goes to the complete library of mysql commands and operators and whatnot.

 

::EDIT::

The formatting of the forums kinda messed up what I had typed, but basically whenever you enter in a command, it ends with ; If you don't put ; at the end, then it will just do a return to the next line with only a > and no mysql> I hope this helps!

Edited by Jacket

Share this post


Link to post
Share on other sites

you said mysqladmin doesn't stay open, not mysql... sheesh...

 

are you doing this?

start-> run-> c:\mysql\bin\mysqladmin -h hostname -u username -p ??? because that won't work...

 

Try this

 

start-> run-> cmd

 

this will give you a command prompt then you can do the rest of the bit

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...