1

i am using xampp.i want to connect mysql with netbeans.i tested my connection while creating new connection from database in services tab.i get the connection successful message.but while trying to create a database i get this error

access denied for user"@'localhost' to database 'student'
6
  • sounds like a permissions issue. do you have create permissions? Commented Feb 15, 2013 at 18:18
  • how can i create permissions or edit them? Commented Feb 15, 2013 at 18:20
  • what kind of database is it? sqllite? Commented Feb 15, 2013 at 18:23
  • if it's sqllite you have to go into the database and update them aswell as updating the sqllite file Commented Feb 15, 2013 at 18:25
  • mysql database.is there something i did not know about this types?if yes please help. Commented Feb 15, 2013 at 18:35

1 Answer 1

2

for mysql

  1. Revoke privileges

    revoke all privileges on *.* from 'student'@'localhost';
    
  2. Then grant the appropriate privileges as desired:

    grant SELECT,INSERT,UPDATE,DELETE ON `db`.* TO 'student'@'localhost';
    

in your case you may want

     GRANT ALL PRIVILEGES ON *.* TO  'student@localhost';

Finally, flush:

    flush privileges;
Sign up to request clarification or add additional context in comments.

8 Comments

i cant create a database and what should i be specifying in db.* ?
Grant all should work for creating db - the second one - don't specify a database if you have . it'll grant you privileges on everything
I got it.After executing grant i got a message as "query ok.0 rows affected".Is that ok?
you might have to start again i.e. revoke, grant and flush
Thanks a lot!in cmd if i execute the command create database it is successful.but in netbeans i still cant create a new database by right clicking on the mysql Server @ localhost.the same access denied error is shown?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.