Skip to main content

Create users in MySQL

Create users

The following steps are explained to you how create the users in MySQL.
  1. This query is used to create a user in the particular host only,
     create user 'username'@'hostname' identified by 'password'; This user cannot access from the other hosts
  2. If you want to the user access from other machines then use the below query,
    create user 'username'@'%';
  3. The below query is used to give the all privileges to the user on the particular database,
    grant all privileges on '<database>.<tables>' to 'username'@'hostname';
  4. The below query is used to give some privileges to users on the particular database,
    grant select,update on '<database>.<tables>' to 'username'@'hostname';




Comments

Popular posts from this blog

Table and its count

Table and its count To view all tables and its count by executing command and immediately, use below commands - MSSQL SELECT      sc. name   + '.' + ta. name   TableName,  SUM (pa. rows ) RowCnt FROM      sys.tables ta INNER   JOIN   sys.partitions pa      ON   pa.OBJECT_ID = ta.OBJECT_ID INNER   JOIN   sys.schemas sc      ON   ta.schema_id = sc.schema_id WHERE   ta.is_ms_shipped = 0  AND   pa.index_id  IN   (1,0) GROUP   BY   sc. name ,ta. name ORDER   BY   SUM (pa. rows )  DESC