On one PC (MySQL server was in the package from Denwer - MySQL version 5.5)
There I open mysql.exe, it immediately works. MySQL console opens On another PC, installed MySQL from the MySQL Installer Community package (the official MySQL Server installer)
On it when you open the file mysql.exe error immediately.
I tried using the command: mysql.exe -uroot -p[password] . Same error:
MySQL Server 5.5, error: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) .
Although the MySQL server itself works. Databases are opened, edited.
There is no experience with the MySQL console.
How to fix it?
And why in one case the console works, but not in the other?


UPD:
if you specify:
mysql.exe -uroot -p[password] --host=localhost - the same thing (Eggog 2003).
What if:
mysql.exe -uroot -p[password] --host=127.0.0.1 - then joins and the console opens.

  • If not difficult to bring my.ini to the server where the connection is not established? - cheops

1 answer 1

As a rule, any console application, if it does not specify arguments at startup, runs with the values ​​of the arguments by default. What happens in your case - the client tries to connect to the database on the local computer, which you do not have. Also, as a rule, console applications provide help on possible arguments. For this, there are standard arguments -? -h /h -help To connect to a remote server, use the mysql --host=hostname --user=myname command mysql --host=hostname --user=myname , where hostname is the name of the computer with the database or its IP address

  • I have a 100% database and I connected to it through the GUI, and here it became necessary to automate the database update process in different cities, so I decided to make cmd's using the mySQL console - I_CaR
  • @I_CaR, then I did not understand why you accepted my answer. - 4per
  • I no longer remember what was guided by accepting your answer, but I think at that moment he pushed me into some kind of thought-correcting situation. - I_CaR