Error logging in My SQL

Asked 2 years ago, Updated 2 years ago, 41 views

When logging in with mysql-h%-uroot-p

ERROR 2005 (HY000): Unknown MySQL server host '%' (0)

will appear

How can I solve this problem?

mysql

2022-09-30 17:56

1 Answers

The % used when granting permissions represents a wildcard in MySQL, so the -h optional argument must be a separate hostname or IP address instead of % when connecting.

>mysql-h localhost-u root-p

Note that the -h option is optional if the MySQL server you are connecting to is running on the (localhost) machine where you want to run the command.

>mysql-u root-p

reference:
Connecting to MySQL Server|MySQL 5.6 Reference Manual


2022-09-30 17:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.