
December 29th, 2002, 09:30 AM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
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 |
|
|
|
<? $user="root"; $host="localhost"; $password="**********"; $database="userdatabase"; //open connection to the MySQL database server. //if connection fails, display the error involved if ($connection == false){ //echo("Your username or password is not correct."); } if($create_success)echo("<b><font color="blue ">create database: success!</font></b><br>"); if($select_success)echo("<b><font color="blue ">selected the created database: success!</font></b>"); $query="CREATE TABLE users ( id int(6) NOT NULL auto_increment, username varchar(30) NOT NULL, password varchar(30) NOT NULL, email varchar(40) NOT NULL, class int(4) NOT NULL, role varchar(10) NOT NULL, average int(3) NOT NULL, points int(4) NOT NULL, tests varchar(256) NOT NULL, blank1 varchar(10) NOT NULL, blank2 varchar(10) NOT NULL, blank3 varchar(10) NOT NULL, PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))"; ?>
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.
|