how do i create a my sql database

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
ivanmiller
-


Joined: 25 May 2004
Posts: 16

PostPosted: Tue Jun 29, 2004 11:14 pm    Post subject: how do i create a my sql database Reply with quote

hi i have my sql, i have the freen light thing at the side of my clock, i wanna know my sql username, password, and database name or create one, how do i do that? when i right click on databases i receibe this options: flush hosts, flush logs, flush tables, flush threads, any other option, so how do i know my sql username, pass, and database name? can someone please help me, my script ask em..
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Tue Jun 29, 2004 11:19 pm    Post subject: Reply with quote

You need to install phpMyAdmin if you want to
create a database , http://os17fan.cjb.net/
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Tue Jun 29, 2004 11:20 pm    Post subject: Reply with quote

First, your username and password are those you entered when you installed MySQL. If you never entered anything, then your username is "root" with no password.

Install phpMyAdmin (along with PHP if you already haven't) using the tutorials in the "Tutorials" section of this forum. The PHP tutorial is available at http://www.aprelium.com/abyssws/php.html .
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
ivanmiller
-


Joined: 25 May 2004
Posts: 16

PostPosted: Tue Jun 29, 2004 11:24 pm    Post subject: Reply with quote

I already have php my admin, but then if my user is root, no password, and which is the database name?
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Tue Jun 29, 2004 11:41 pm    Post subject: Reply with quote

There are two default databases: mysql, and test. Once in phpMyAdmin, you can just fill out the text box on the first page to make a new database.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
00squeaky
-


Joined: 11 May 2004
Posts: 60

PostPosted: Fri Jul 02, 2004 9:20 am    Post subject: Reply with quote

or you could do it the hard way bby finding the program called mysql in the bin folder of mysql. or use these usefull php scripts.

Code:

//set up a mysql connection
$link = mysql_connect('your ip', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}

//connect to a database
$db_selected = mysql_select_db('your database', $link);
if (!$db_selected) {
die ('Cannot use requested database<BR>  ' . mysql_error());
}

//create a database
if (mysql_create_db('a database')) {
    echo "Database created successfully\n";
} else {
    echo 'Error creating database: ' . mysql_error() . "\n";
}

//query a databbase
$sql="create database yourdb";
mysql_query($sql);




for creating databases, that is all you really need to know.
_________________
Languages mastered:
HTML,GML,C,PHP,MYSQL (not really a language, but wtf)
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group