EPUB | CHM | PDF

TMySQLDatabase.Methods.ChangeUser

Top Previous Next

note Since v2.7.0

Changes current user and database without re-establishing database connection. MySQL library mysql_change_user function analog.

Syntax:

function ChangeUser(const aNewUserName : string;
                    const aUserPassword : string;
                    const aDatabaseName : string = '') : boolean;

Description:

Use ChangeUser method to change current user and database for current database connection.

aNewUserName

Name of user to change with.

aUserPassword

Password of user specified in aNewUserName param.

aDatabaseName

Name of database to switch to. If this is empty or omitted then current database remains the same.

ChangeUser method returns True if current user and/or database was changed successfully. Method returns False without changing current user and/or database if operation fails.

note Take a look at MySQL library mysql_change_user function description: http://dev.mysql.com/doc/refman/5.1/en/mysql-change-user.html