3

Im using mysql workbench to manage the database of an application am creating. The problem is i have a table called user which contains the usernames and passwords of all my users but they cant login till i go into the mysql workbench server administration and add them one by one under Users and Privileges again before they can login.

I was wondering if there was an easier or faster way to do this. i have over a 100 users to add.

1 Answer 1

4

You need to run FLUSH PRIVILEGES; for any changes to the mysql.user database to take effect.

MySQL Workbench will do this automatically when adding a user, but if you're manually adding people to the mysql.user database, then you'll need to manually run the FLUSH PRIVILEGES; SQL too.

From the MySQL docs,

PRIVILEGES

Reloads the privileges from the grant tables in the mysql database.

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

10 Comments

im using the INSERT INTO statement to add the bulk users to user table, am still unable to login even after running the flush privileges. it just says 0 rows affected... :/
Any reason why you're creating users directly into the table rather than using CREATE USER (dev.mysql.com/doc/refman/5.1/en/create-user.html) and GRANT (dev.mysql.com/doc/refman/5.1/en/grant.html)? And just to clarify, we're talking about MySQL users in the mysql.user table right? (Not users for your application or anything)
nah...i thought that there might be a way that the users from the user table of my application's database to login. sorry im new to this, didnt even know about the mysql.user, how do i add the users to that? THANKS
hey can i use phpmyadmin with mysql workbench to do this? do i also have to install xampp?
phpmyadmin is separate to Workbench, it's probably best to use one or the other, as they both do the same thing (there may be some feature difference, but essentially they're trying to do the same job). Just that workbench runs as a desktop application, and phpmyadmin has to be run on a server with PHP installed. As for your users, if they're application users do they really need direct database access? I suspect not. If you really do want to add users who can login to the MySQL database you can use CREATE USER and GRANT queries to do it (see the docs links in my other comment).
|

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.