Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

mySQL prob

Options
  • 07-09-2004 8:01pm
    #1
    Registered Users Posts: 1,771 ✭✭✭


    hi guys,

    just a quick question, somebody should be able to sort it for me, its wrecking my head at this stage!

    installed mysql no probs, set up the my.ini file in the winnt folder with the username and password set. I run the server (mysqld) then go to my command prompt and type

    mysql> mysql -u conor -p

    then enter my password, but keep gettin access denied everytime, i can't see where the problem is, ive checked the username and password countless times, theres no problem there, do i need to set special privilages or something? anyone got an ideas?

    cheers


Comments

  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    Does "mysql -u root -p" (with empty password) work? Have you set up the conor user in the mysql database? If so, have you granted him access to the desired database? If this is double dutch read the authentication chapter of the SQL manual which describes how users and privileges work.

    .cg


  • Registered Users Posts: 1,771 ✭✭✭jebuz


    yea i can log in as root, i see wat u mean now. so how do u insert a user is it a matter of 'insert into user values("conor", "password"); or something, and how would u set his privilages, cheers


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    You need the "GRANT" command. You use that when logged in as root to create new users and give users specific access rights. Here's the manual page for it: http://dev.mysql.com/doc/mysql/en/Adding_users.html


  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    jebuz wrote:
    yea i can log in as root, i see wat u mean now. so how do u insert a user is it a matter of 'insert into user values("conor", "password"); or something, and how would u set his privilages, cheers
    Not being smart, but read the chapter in the manual... you can use the GRANT command like NeverSayDie says, or you can do it like you say ...
    INSERT INTO user ( host, user, password ) VALUES ( 'localhost', 'conor', password( 'conorpwd' ) );
    INSERT INTO db ( host, db, user, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv ) VALUES ( '%', 'conordb', 'conor', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y' );
    flush privileges;
    

    ... but you should read the manual so that you understand the implications of doing above.

    .cg


  • Registered Users Posts: 1,771 ✭✭✭jebuz


    ya cheers lads, got it workin fine for now


  • Advertisement
Advertisement