How do I set the default schema for a user in MySQL

There is no default database for user. There is default database for current session.

You can get it using DATABASE() function –

SELECT DATABASE();

And you can set it using USE statement –

USE database1;

You should set it manually – USE db_name, or in the connection string.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)