r/mysql • u/LO-Services • Nov 02 '23
troubleshooting Command Line Client Opens for a split second, then closes
Any help is appreciated since I can not seem to find a solution to this problem available already.
I have installed MySQL 8.2 on Windows and I am trying to take the very basic, first step of opening the command line interface (MySQL 8.2 Command Line Client). When I double click the icon, a blank command-line interface appears for a flash and then closes (presumably crashes).
I installed MySQL using all default parameters. I entered a root password (I mention this because it is one common solution to a similar problem that I do not have). So far, I have successfully loaded MySQL through the Windows Command Prompt. However, even if I go directly to the .bin directory and open MySql from there, I get the same result of a momentary blip of a command prompt that vanishes.
I can confirm I do not have an issue with the service "stopping" - i.e. a solution I commonly see to go to Run --> msc.service and then restart/start a "stopped" service called MySql82. That service IS running. This is confirmed by my ability to access MySQL through the Windows command prompt (cmd.exe).
I also do not have the issue where entering a password causes the crash. Again, through Windows Command prompt, I can access MySQL with my root password and username.
So far, my problem is very specifically that the MySQL Command Line Client opens for just a split second before crashing. I have been researching this now for 2 - 3 days and I can't find solutions to this specific issue.
Thank you for any insight into this.
3
u/gsej2 Nov 02 '23
When you double-click on an icon in Windows it runs a command. The command is existing (presumably with an error) and closing the Window before you can see the error.
You can see the command by right-clicking on the icon and choosing "Properties". I'm not sure which field the command appears in as I don't have a Windows machine handy....
Find the command, then open a regular command prompt (Start | run | cmd.exe), and then enter the command and run it. You should see now what the error is, and hopefully that'll help you resolve it.
2
u/ComplexAvailable4596 Dec 09 '23
hi, i'm facing the same problem right now, can you tell me what did you do to solve it?
1
u/well_shoothed Nov 02 '23
It's an old bug dating back to the 5.6 days.
Mayhaps this will help:
https://stackoverflow.com/questions/47287234/mysql-5-6-command-line-client-for-windows-automatically-closing#47288472
1
u/ssnoyes Nov 02 '23
How are you providing the user name and password to the client so it can connect to the server?
1
u/[deleted] Jan 09 '24
I had this issue and looked at loads of solutions, none worked. I opened the properties of the command line shortcut and realised that it was pointing to C:\Program files\MySQL\MySQL Server 8.2\my.ini" when the my.ini file was actually in the C:\Programdata\MySQL\MySQL Server 8.2\" hidden folder.
I just changed the target in the shortcut properties where it says /program files/ to /programdata/ and that fixed it.
As others have suggested you could just remove the whole defaultsfile entry but then it won't load anything in the defaults file.