Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Commands to Create a MySQL DB? (http://www.greenguysboard.com/board/showthread.php?t=319)

EclectiXXX 2003-08-29 10:56 AM

Commands to Create a MySQL DB?
 
|waves| Oh Cleo.... and anyone else....

One of the threads we lost was the one discussing how to create a MySQL DB from the UNIX prompt.....

Dr Bizzaro 2003-08-29 11:24 AM

This one worked for Moses:

"I COMMAND THEE TO BE A MYSQL DATABASE AND THY MUST WORK PROPERLY AND BE TRUE"!.

EclectiXXX 2003-08-29 11:43 AM

LOL but then the damn thing went and spawned a bunch of golden tables profaning the name of it's Root creator and was almost deleted!!!

Dr Bizzaro 2003-08-29 12:04 PM

Quote:

Originally posted by EclectiXXX
LOL but then the damn thing went and spawned a bunch of golden tables profaning the name of it's Root creator and was almost deleted!!!

|buddy| "ABORT! ABORT!"

Cleo 2003-08-29 02:25 PM

Re: Commands to Create a MySQL DB?
 
Quote:

Originally posted by EclectiXXX
|waves| One of the threads we lost was the one discussing how to create a MySQL DB from the UNIX prompt.....
Damn if I know, all the hosts that I have ever had it was done through the control panel so I never had to learn how to do it from a shell.

man mysql

That should point you in the right direction. :)

Also I did a fast search on Google and found this
http://perl.about.com/library/weekly/aa020601a.htm

nickk 2003-08-31 04:17 PM

doh, thought you said how to create a table,
to create a db just type 'CREATE DATABASE [dbname]' once you logged into mysql.

to create a table:

you have to login to mysql first:
mysql -u [username] -p
it'll ask your for your pass
then, type: use [databasename];

then something of this sort to create the database:
CREATE TABLE [table name]
(
ID INT AUTO_INCREMENT,
name VARCHAR(35) NOT NULL,
name2 int,
name3 date,
name4 text,

PRIMARY KEY (ID)
);

where name,name2... are variables of your choice, and int,date,varchar,text are variable types.

venturi 2003-09-07 07:54 AM

Almost right there Nickk. :D

first log into mySQL as Nickk said. But do not do the "use" command yet.

type: create database \g
type: use \g
type: grant all on for \g

Then you can add tables, etc.
You may have to have root access in order to do the above, depending upon your account settings with your host.


All times are GMT -4. The time now is 01:59 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc