Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old December 29th, 2002, 09:30 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
I've installed mySQL - What now?

Finally I've got round to installing mySQL on my hard-drive. When loading some admin thingy, I was instructed to put 'root' as my username (and I made up a password also).

However, whenever I try to run the script to create a new database, I always get an 'Access Denied' error. Please can you help! Once I've actually got a database running, I should be fine learning the commands to manipulate it.

Here is my code:

php Code:
Original - php Code
  1.  
  2. <?
  3. $user="root";
  4. $host="localhost";
  5. $password="**********";
  6. $database="userdatabase";
  7.  
  8. //open connection to the MySQL database server.
  9. $connection = mysql_connect($host,$username,$password);
  10. //if connection fails, display the error involved
  11. if ($connection == false){
  12.   echo mysql_errno().": ".mysql_error()."<BR>";
  13.   //echo("Your username or password is not correct.");
  14.   exit;
  15. } 
  16.  
  17.  
  18. $create_success = mysql_create_db("users");
  19. if($create_success)echo("<b><font color="blue">create database: success!</font></b><br>");
  20. $select_success = mysql_select_db("users");
  21. if($select_success)echo("<b><font color="blue">selected the created database: success!</font></b>");
  22.  
  23.  
  24.  
  25. $query="CREATE TABLE users (
  26. id int(6) NOT NULL auto_increment,
  27. username varchar(30) NOT NULL,
  28. password varchar(30) NOT NULL,
  29. email varchar(40) NOT NULL,
  30. class int(4) NOT NULL,
  31. role varchar(10) NOT NULL,
  32. average int(3) NOT NULL,
  33. points int(4) NOT NULL,
  34. tests varchar(256) NOT NULL,
  35. blank1 varchar(10) NOT NULL,
  36. blank2 varchar(10) NOT NULL,
  37. blank3 varchar(10) NOT NULL,
  38. PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
  39. mysql_query($query);
  40. ?>



I must have forgotten to do something. If I entered a username and password for 'winmysqladmin', how would these settings be transferred online?
All help gratefully appreciated.

Reply With Quote
  #2  
Old December 29th, 2002, 11:26 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: I've installed mySQL - What now?

Ignore the code above now. I've gone into MS-DOS, and accessed mySQL by typing: 'C:mysqlbinmysql mysql'
I've created a database called 'userdatabase' and a table within it called 'users'.
However, I'm assuming this table is stored on my hard-drive rather than on the internet. How do I get my database transferred to the internet, and then how do I access it?

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > I've installed mySQL - What now?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway