Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

How to create new user and grant permission in MySQL

How to create new user and grant permission in MySQL

 
Post new topic   Reply to topic     Forum Index -> DataBase, RDBMS, MySql, Oracle, db2, SQL Server problems
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Fri Aug 29, 2008 8:34 am    Post subject: How to create new user and grant permission in MySQL Reply with quote

Hi,

Mysql Database can create more than one user and allow to login from remote system. You will not come to database server to run your queries. User can also help to keep separate permission and task from one to others. This mysql is also have function like in Oracle.

This is not restricted with IP or domain. We can also restrict IP based login to database

This is Without IP based allow in anywhere to login
Code:

create user <userName> identified by 'password';


This will make User in mysql Database of mysql

But it will not assign permissions to this user

We need to grant permission to this user in mysql

Code:
grant all privileges  on *.* to <userName> identified by 'password'


Note:
1. *.* is first * is database, allow all database second * related to tables in that database
2. If you want to give select permission then

Code:
grant select on *.* to <userName> identified by 'password'


Code:
grant select, insert on *.* to <userName> identified by 'password'


If you want to bind user with particular IP and system. You can allow to particular IP address to login that user

e.g
Code:

create user <userName>@192.168.1.29 identified by 'password';
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DataBase, RDBMS, MySql, Oracle, db2, SQL Server problems All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack