Solve the problem of MySql client exiting in seconds (my.ini not found)

Solve the problem of MySql client exiting in seconds (my.ini not found)

Problem description (environment: windows7, MySql8.0)

After installing MySql today, I started the MySql service. If the service startup fails, don't read on and solve it yourself by searching on Baidu.
The client exits immediately after opening, but the database can be used in cmd.
Normally, as long as it works, it's fine, but for the convenience of the client, I don't want to type that line of code. I just searched on the Internet, Baidu, Google, and tried various methods.
Finally found that it was useless. The problems were similar, but not exactly the same.

The pitfalls I encountered (not saying that what others said is wrong, it’s just that it’s useless to me)

Pitfall 1: People on the Internet say that there is a problem with the my.ini file, but there is no my.ini file in my installation path
Pitfall 2: Change the file ending with .ini to my.ini
Pitfall 3: I found out that there was no my.ini, so I created my.ini, created a data folder, uninstalled the service, and reinstalled it, but it didn’t work.
Anyway, all the opinions revolve around the my.ini file.

solve

I believe many people have seen this picture when searching on the Internet.

I installed it by default:

"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe" "--defaults-file=C:\Program Files\MySQL\MySQL Server 8.0\my.ini" "-uroot" "-p"
As most people say on the Internet, there is no my.ini file in this path --> my.ini is a configuration file for MySql. And have you noticed that there is no Data folder as mentioned on the Internet --> Data is most of the time a folder for storing data

At this time, I am not thinking about how to change it, but whether I should find

Finally I found Data and my.ini in MySQL\MySQL Server 8.0\ under C:\ProgramData --> C:\ProgramData which is a hidden folder

at last

Change the path in the figure to C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" "-uroot" "-p"
In fact, it is to change file=C:\Program Files to file=C:\ProgramData

Just open the client

Summarize

The above is the editor’s introduction to solving the problem of MySql client exiting immediately (my.ini cannot be found). I hope it will be helpful to everyone!

You may also be interested in:
  • Introduction to using the MySQL mysqladmin client
  • How does MySQL connect to the corresponding client process?
  • PHP Swoole asynchronous MySQL client implementation example
  • Solve the problem that the Node.js mysql client does not support the authentication protocol
  • Solution to the problem that the mysql8.0.11 client cannot log in
  • Detailed explanation of MySQL/Java server support for emoji and problem solving
  • Getting started with NodeJS server development (Express+MySQL)
  • MySQL connection pool for App server (supports high concurrency)
  • Interpreting MySQL client and server protocols

<<:  HTML+CSS+JavaScript to make a girlfriend version of scratch card (you will learn it once you see it)

>>:  The most complete tutorial on installing centos8.1 with VMware15.5 and the problem of insufficient physical memory

Recommend

In-depth explanation of the global status of WeChat applet

Preface In WeChat applet, you can use globalData ...

Ubuntu 18.04 disable/enable touchpad via command

In Ubuntu, you often encounter the situation wher...

Automated front-end deployment based on Docker, Nginx and Jenkins

Table of contents Preliminary preparation Deploym...

How to use file writing to debug a Linux application

In Linux, everything is a file, so the Android sy...

Summary of MySQL InnoDB architecture

Table of contents introduction 1. Overall archite...

The vue project realizes drawing a watermark in a certain area

This article shares with you how to use Vue to dr...

How to retrieve password for mysql 8.0.22 on Mac

Mac latest version of MySQL 8.0.22 password recov...

MySQL learning database operation DML detailed explanation for beginners

Table of contents 1. Insert statement 1.1 Insert ...

Solution to Docker disk space cleaning

Some time ago, I encountered the problem that the...

Analysis of MySQL's planned tasks and event scheduling examples

This article uses examples to describe MySQL'...

Implementation of MySQL scheduled database backup (full database backup)

Table of contents 1. MySQL data backup 1.1, mysql...

Detailed explanation of Getter usage in vuex

Preface Vuex allows us to define "getters&qu...