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
# Create ( ZN> = 3.0.7 )
Used to identify the user to the database.
String | $ name | User name. |
return | Bool |
DBUser::create('zntr@localhost');
DBUser::create('zntr@%');
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 ])
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.
String | $ password | Password. |
return | this |
DBUser::password('998891')->create('zntr@localhost');
# Drop ( ZN >= 3.0.7 )
Used to delete the user.
String | $ name | User name. |
return | Bool |
DBUser::drop('zntr@localhost');
# Alter ( ZN >= 3.0.7 )
Editing user information.
String | $ name | User name. |
return | Bool |
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 .
String | $ name | Authority name. |
return | Bool |
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
String | $ name | Authority name. |
return | Bool |
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.
String | $ Oldname Game | Old username. |
String | $ NewName | New user name. |
return | Bool |
DBUser::rename('zn@localhost', 'zn@127.0.0.1');