DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

Create a MySQL user account | MySQL | Tech-Recipes

Started by qdideas · 9 ヶ月 ago

No excerpt available. Jump to website »

9 comments

  • Don't forget to "flush privileges" afterwards.
  • grant all on accounts.* to jsmith@localhost identified by 'Secret15';

    This only work's for the localhost how do i create an account that can be accesd by any ip and not from the same pc of the server ???? 8O
  • You can specify the hostname or IP address that is allowed access in place of localhost in this command. So, if you want to be able to connect from a host named 'workstation' (10.100.15.2), use one of these:

    grant all on accounts.* to jsmith@workstation identified by 'Secret15';
    grant all on accounts.* to jsmith@10.100.15.2 identified by 'Secret15';

    A dubious alternative, one with serious security consequences (you've been warned) is to allow access to jsmith from anywhere:

    grant all on accounts.* to jsmith@% identified by 'Secret15';

    In this context, the % symbol is a wildcard permitting access from any host. An important note - from my experience, it is necessary to create the localhost access control in addition to a specific host or global access control. If you do not, connections from localhost may not function properly.
  • <ul id="quote"><h6>Anonymous wrote:</h6>Don't forget to "flush privileges" afterwards.</ul>

    I read that flushing privileges is only neccessary if you use insert instead of grant:

    "The reason for using FLUSH PRIVILEGES when you create accounts with INSERT is to tell the server to re-read the grant tables. Otherwise, the changes will go unnoticed until you restart the server. With GRANT, FLUSH PRIVILEGES is unnecessary."

    Quote from http://dev.mysql.com/doc/mysql/en/Adding_users.html
  • <ul id="quote"><h6>Anonymous wrote:</h6>Don't forget to "flush privileges" afterwards.</ul>
  • <ul id="quote"><h6>Anonymous wrote:</h6></ul><ul id="quote"><h6>Anonymous wrote:</h6>Don't forget to "flush privileges" afterwards.</ul>

    I read that flushing privileges is only neccessary if you use insert instead of grant:

    "The reason for using FLUSH PRIVILEGES when you create accounts with INSERT is to tell the server to re-read the grant tables. Otherwise, the changes will go unnoticed until you restart the server. With GRANT, FLUSH PRIVILEGES is unnecessary."

    Quote from http://dev.mysql.com/doc/mysql/en/Adding_users.html
  • This is very nice.. and good... Kenny Vadas
  • <ul id="quote"><h6>Kenny Vadas wrote:</h6>This is very nice.. and good... Kenny Vadas</ul>
  • Hi friend. thank u very much. your sample code working good.

Add New Comment

Returning? Login