Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error creating db

Status
Not open for further replies.

vintl

Technical User
Jun 9, 2000
72
0
0
MY
hi
i follow your instruction on the DJG's Setting up MySQL users and databases Guide. the following is what i got.
i got an error when i try to create the database at the end.
if u are suggesting me to visit this site for your info, its dead. i can't access it. so if you dont mind, pls post the help for me here. pls specify how to do the grant stuff step by step.
thanx


mysqladmin -u root password 'mypassword'
mysql -u root -p
mysql> use mysql;
Database changed
mysql>
mysql> insert into
-> host(host,db,Select_priv, Insert_priv, Update_priv,
-> Delete_priv, Create_priv, Drop_priv)
-> values('localhost','%','Y','Y','Y','Y','Y','Y');
mysql> insert into
-> user (host, user, password)
-> values('localhost','djg',password('mypassword'));
mysql> insert into
-> db (host,db,user,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
-> values ('localhost','mydatabase','djg','Y','Y','Y','Y','Y','Y');
mysql> quit
mysqladmin -u -p create mydatabase
mysqladmin: CREATE DATABASE failed; error: Access denied for user: 'localhost' to database 'databasename'
 
Oh, your problem may be...

mysqladmin -u -p create mydatabase

I believe you need a username after -u

mysqladmin -u root -p create mydatabase

or somethign similar, I don't know how you have mysql set up.
 
Also, changes to the grant tables don't take effect until you either restart the server or issue a
Code:
FLUSH PRIVILEGES
command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top