Database User Library



( ZN >= 3.0.7 )

This section is the library where the database includes methods such as creating user, deleting and setting permissions.

 

 

# Methods


Bool create ( String $ name )
this password ( String $ authString )
Bool drop ( String $ name )
Bool alter ( String $ name )
Bool grant ( String $ name = ' ALL ' , String $ type = NULL , String $ select = '*. *' )
Bool revoke ( String $ name = ' ALL ' , String $ type = NULL , String $ select = '*. *' )
Bool rename ( String $ oldName , String $ newName )

 

 

 

# Create ( ZN> = 3.0.7 )


Used to identify the user to the database.

Parameters
String $ name User name.
return Bool
uses
DBUser::create('zntr@localhost');
DBUser::create('zntr@%');
MySQL Schema

DBUser :: [ -> name ( $ user ) ]
        [ -> host ( $ host ) ]
        [
            -> password ( $ password )                   |
            -> identifiedBy ( $ password )               |
            -> identifiedAs ( $ encode , password)       |
            -> identifiedWithBy ( $ encode , $ password ) |
            -> identifiedByPassword ( $ password )
        ]
        [ ->required () ]
        [ -> encode ( $ type , $ string [ $ conditioning ]) ]
        [ -> with () ]
        [ -> grantoptio's () ]
        [ -> resource ( $ resource , $ count ) ]
        [ -> passwordExpire ( $ type , [ $ count ]) ]
        [ -> lock () | -> unlock () ]
        -> create ([ $ user ])| -> alter ([ $ user ])

Postgre Scheme

Dbuser :: [ -> name ( $ user ) ]
        [ -> with () ]
        [ -> option ( $ option , $ value ) ]
        -> create ([ $ user ]) | -> alter ([ $ user ]) 

 

 

# Password ( ZN >= 3.0.7 )


The user is used to create a password when defining the user.

Parameters
String $ password Password.
return this
uses
DBUser::password('998891')->create('zntr@localhost');

 

 

# Drop ( ZN >= 3.0.7 )


Used to delete the user.

Parameters
String $ name User name.
return Bool
uses
DBUser::drop('zntr@localhost');

 

 

# Alter ( ZN >= 3.0.7 )


Editing user information.

Parameters
String $ name User name.
return Bool
uses
DBUser::password('998892')->alter('zntr@localhost');

 

 

# Grant ( ZN >= 3.0.7 )


Used to identify authority to the user. Take a look at SQL resources for using GRANT .

Parameters
String $ name Authority name.
return Bool
uses
DBUser::select('db1.*')
      ->name('zn@localhost')
      ->grant('all');

 

 

# Revoke ( ZN >= 3.0.7 )


Used to identify authority to the user. Browse SQL resources for REVOKE usage

Parameters
String $ name Authority name.
return Bool
uses
DBUser::select('*.*')
      ->name('zn@localhost')
      ->revoke('insert');

 

 

# Rename ( ZN >= 3.0.7 )


Used to change the user name. The first parameter is the old name, the second parameter is the new name.

Parameters
String $ Oldname Game Old username.
String $ NewName New user name.
return Bool
uses
DBUser::rename('zn@localhost', 'zn@127.0.0.1');