Bug #46231 Set default database by user login

Submitted: 16 Jul 2009 15:48
Reporter: Scott Noyes Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[16 Jul 2009 15:48] Scott Noyes
Description:
Sybase provides a default database for each user, which is set automatically on login. Provide similar functionality for MySQL.

How to repeat:
mysql -u userName
SELECT DATABASE(); -- should automatically be set to default database for the given userName

Suggested fix:
If the USE statement were allowed in prepared statements, then we could write this into an init-connect statement.

Or, DATABASE() could accept a parameter that would set the current database to the given parameter.

Or, the privilege system could be extended to include a default database for each user in the mysql.user table.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.