If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to work with winmysql admin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-22-07, 16:51
dimitar dimitar is offline
Registered User
 
Join Date: Nov 2007
Posts: 3
How to work with winmysql admin

http://img259.imageshack.us/img259/6200/mysqlhd8.jpg

How to make new database, and what should i enter in this

PHP Code:
mysql_connect("localhost","username","pass") or die(mysql_error());  
mysql_select_db("database") or die(mysql_error()); 

Last edited by dimitar; 11-22-07 at 17:19.
Reply With Quote
  #2 (permalink)  
Old 11-22-07, 17:00
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-23-07, 03:57
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
personally Id rather use MySQLAdmin from the MySQL GUI Tools suite available from the MySQL website.

then you need to create your db
create the user account(s) and assign appropriate permissions
then you need to create the tables

then once you have done all that you can start looking at PHP
if you are unsure of what to put in the PHP connect and select statements then the php website is pretty helpful

just out of curiosity what, if anything, do you think you should put in place of
"localhost"?
"username"?
"pass"?
"database"?
Reply With Quote
  #4 (permalink)  
Old 11-23-07, 05:01
dimitar dimitar is offline
Registered User
 
Join Date: Nov 2007
Posts: 3
Reading the tutorial i think that instead of username, i should use root, instead of pass nothing(empty)-that makes the problem, and database, i don't know.

I'll try MySQLAdmin, but how can i add it to xampp?
Reply With Quote
  #5 (permalink)  
Old 11-23-07, 05:24
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
why would you want to add MySQLAdmin to xampp?
its a stand alone application that talks to any MySQL server that you are allowed to connect to.
incidentally its not a good idea to have a MySQL server with a userid of root and a null/empty password.. not clever.. it leaves your server wide open to attack

if you want to leave the user root but assign it no permissions, or better still change the password, or possibly delete root. if you do delete user root make sure you have already created a new adminstrator puserid.. and proved it has full rights to do anything to your MySQL server.

Id suggest you create a web user account for the server which access only to the db it requires and permsiions suitable to that user (ie cannot create or delete tables, can only view the tabels it should
And if required create other accounts with access

as regards your guesses.. yup thats rght
so "database" should be replaced with the naem of the databse the php script is meant to connect to

its often a smart idea to have some form of initialisation code which sets these as variables. often this intialisation code is pulled in using an include statement as jsut about the first line of each script requiring db access. So instead of...

mysql_connect("localhost","username","pass") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());

you use something like....

mysql_connect($Host,$Username,$Password) or die(mysql_error());
mysql_select_db($Database) or die(mysql_error());

of if you prefer use a define (by PHP convention user DEFINES are all CAPTIALS, note there is no $ prefixing the define as it is a constant not a variable
DEFINE (HOST,"myhostname");
DEFINE (USERNAME,"myusername");
DEFINE(PASSWORD,"mypassword");
DEFINE(DATABASE,"mydbname");

.. then in your app scripts
mysql_connect(HOST,USERNAME,PASSWORD) or die(mysql_error());
mysql_select_db(DATABASE) or die(mysql_error());
Reply With Quote
  #6 (permalink)  
Old 11-23-07, 12:26
dimitar dimitar is offline
Registered User
 
Join Date: Nov 2007
Posts: 3
You don't understand me. I know to work with php and mysqlu but i don't know to work with the mysql server. I'll download now and try it.

I downloaded MySQL GUI, but i dont know to work with it. Some guide?

Last edited by dimitar; 11-23-07 at 12:47.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On