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

A commonplace technique for implementing triangles using CSS (multiple methods)

In some interview experiences, you can often see ...

The reason why MySQL uses B+ tree as its underlying data structure

We all know that the underlying data structure of...

Detailed tutorial on MySql installation and uninstallation

This article shares the tutorial of MySql install...

Summary of some common techniques in front-end development

1. How to display the date on the right in the art...

How to enter directory/folder in Linux without using CD command

As we all know, without the cd command, we cannot...

Analysis of the locking mechanism of MySQL database

In the case of concurrent access, non-repeatable ...

Nginx tp3.2.3 404 problem solution

Recently I changed Apache to nginx. When I moved ...

How to operate MySQL database with ORM model framework

What is ORM? ORM stands for Object Relational Map...

Introducing icons by implementing custom components based on Vue

Preface In project development, there are many wa...

Vue implements a simple magnifying glass effect

This article example shares the specific code of ...

VMware Workstation 12 Pro Linux installation tutorial

This article records the VMware Workstation 12 Pr...

jQuery implements the function of adding and deleting employee information

This article shares the specific code of jQuery t...

JavaScript to implement simple carousel chart most complete code analysis (ES5)

This article shares the specific code for JavaScr...