when I connect to a mysql database in the following way an error is printed asking me to introduce user as username@hostname:
mysql -h <hostname> -u<user_name> -P 3306 -p<password>
Introducing it in that other way it works:
mysql -h <hostname> -u<user_name>@<hostname> -P 3306 -p<password>
However, my workmates are able to connect to the database putting only the user, since you are indicating the host with option -h
Why? PD: mysql --version mysql Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using EditLine wrapper
CodePudding user response:
The error 9002 is specific to Microsoft Azure, not plain MySQL.
For Azure Database for MySQL, you need to add
@<servername>
to the admin user name, as shown here:mysql --host=mydemoserver.mysql.database.azure.com --user=myadmin@mydemoserver -p
I don't use Azure, and I don't know why they have this requirement. I suggest you ask their technical support.