mysql_change_user — Changes the user of the current database connection
my_bool mysql_change_user(MYSQL * mysql,
const char * user,
const char * passwd,
const char * db);
Changes the user and default database of the current connection.
In order to successfully change users a valid username and password parameters must be provided and that user must have sufficient permissions to access the desired database. If for any reason authorization fails, the current user authentication will remain
mysql
A mysql handle, which was previously allocated by mysql_init()
or mysql_real_connect()
.
user
The user name for server authentication
passwd
The password for server authentication
db
The default database
If desired, the NULL value may be passed resulting in only changing the user and not selecting a database. To select a database in this case use the mysql_select_db()
function.
|