How to view the database installation path in MySQL

How to view the database installation path in MySQL

We can view the installation path of mysql through the mysql command:

# Either of the following two SQL statements can be queried: select @@basedir as basePath from dual;
show variables like '%basedir%';

The basic installation path can be seen above. To check the path of the database data, it is very simple. Just replace the above parameter variable with datadir:

# Any of the following queries can be used select @@datadir as dataPath from dual;
show variables Like '%datadir%';

Of course, the above is based on being able to log in to the MySQL window to view it. Then friends will ask, if you don’t know the account password to log in to MySQL, how can you view the MySQL path?

Method 1:

1: Query the path where the running file is located

which mysql

Then you can connect to Mysql through /usr/bin/mysql -u account -p password:

Then execute any of the above MySQL to view the installation path. Is this too complicated? It can be simpler.

Method 2:

View the installation information of mysql:

ps -ef | grep mysql

The red mark shows the specific path.

This is the end of this article about how to view the database installation path in MySQL. For more information about MySQL database installation path, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

<<:  H tags should be used reasonably in web page production

>>:  Quickjs encapsulates JavaScript sandbox details

Recommend

Detailed analysis of the MySQL slow log opening method and storage format

In development projects, we can monitor SQL with ...

Solve the mysql user deletion bug

When the author was using MySQL to add a user, he...

Detailed explanation of mysql filtering replication ideas

Table of contents mysql filtered replication Impl...

How to install redis in Docke

1. Search for redis image docker search redis 2. ...

Use JS to zoom in and out when you put the mouse on the image

Use JS to zoom in and out when the mouse is on th...

Understanding MySQL clustered indexes and how clustered indexes grow

In this note, we briefly describe What is the B+T...

5 ways to quickly remove the blank space of Inline-Block in HTML

The inline-block property value becomes very usef...

Navicat for MySQL 15 Registration and Activation Detailed Tutorial

1. Download Navicat for MySQL 15 https://www.navi...

vue $set implements assignment of values ​​to array collection objects

Vue $set array collection object assignment In th...

Linux file and user management practice

1. Display the files or directories in the /etc d...

Summary of MySQL development standards and usage skills

1. Naming conventions 1. Database names, table na...

CSS style reset and clear (to make different browsers display the same effect)

In order to make the page display consistent betwe...

Use CSS's clip-path property to display irregular graphics

clip-path CSS properties use clipping to create t...