Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to query paths for mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to query the path of mysql, the article is very detailed, has a certain reference value, interested friends must read it!

Methods: 1, use the "show variables like'% basedir%';" command to query the basic installation path of the file; 2, use the "show variables Like'% datadir%';" command to query the path of the database data.

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to query paths for mysql

Sometimes we don't always remember the installation path of the database during the development process. For example, to see where the installation directory of the mysql database is:

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

# either of the following two sql can be queried

Select @ @ basedir as basePath from dual; show variables like'% basedir%'

You can see the basic installation path above. Check the path of the database data. It is simple to change the above parameter variable to datadir:

# any of the following queries can be made

Select @ @ datadir as dataPath from dual; show variables Like'% datadir%'

Of course, the above is based on the ability to log in to the mysql window to check, then friends will ask, if you do not know the password to log into the mysql account, then how to check the mysql path?

Method 1:

1: query the path where the running file is located

Which mysql

You can then connect to Mysql with the / usr/bin/mysql-u account-p password:

Then execute any of the above MySQL to view the installation path. Is this kind of tedious, but also more simple?

Method 2:

View the installation information for mysql:

Ps-ef | grep mysql

Marked in red, you can see the specific path.

The above is all the contents of the article "how to query the path in mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report