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 explanation of the sticky position attribute in CSS

When developing mobile apps, you often encounter ...

How to use the vue timeline component

This article example shares the specific implemen...

Detailed explanation of computed properties in Vue

Table of contents Interpolation Expressions metho...

JavaScript to achieve digital clock effects

This article example shares the specific code for...

Importance of background color declaration when writing styles

As the title says, otherwise when the page is revi...

Mysql Sql statement comments

You can add comments to MySQL SQL statements. Her...

Vue's global watermark implementation example

Table of contents 1. Create a watermark Js file 2...

mysql8.0.11 winx64 manual installation and configuration tutorial

First of all, let me talk to you about my daily l...

Implementing simple chat room dialogue based on websocket

This article shares the specific code for impleme...

DOM operation implementation in react

Table of contents Previous words Usage scenarios ...

How to use vue filter

Table of contents Overview Defining filters Use o...