0

When I change the TCP/IP Port the MySQL Server will listen on port=3306 to port=3808 in my.ini, my Django project works very well. Navicat also can login in to mysql with same user name and password.

But I can't login into mysql via the command-line. Logins to mysql give this error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

Even if I add skip-name-resolve to the [mysqld] block in my.ini. The error only disappears when I change the port back to 3306.

How can I resolve this problem?

slm
  • 7,355
  • 16
  • 54
  • 72
Mithril
  • 483
  • 1
  • 7
  • 10

2 Answers2

0

What is the command you're using to log in?

Try forcing TCP protocol:

mysql --port=3808 --protocol=TCP -u root -p
Falcon Momot
  • 24,975
  • 13
  • 61
  • 92
  • It works,thank you! It's strange that mysql in command-line do not read the `my.ini` which I think it should. – Mithril Aug 30 '13 at 05:49
0

[mysqld] section is for your server while mysql cli uses [client] section

The [client] option group is read by all client programs (but not by mysqld). This enables you to specify options that apply to all clients. For example, [client] is the perfect group to use to specify the password that you use to connect to the server

Source