Default installation path for installing MySQL with RPM package

Source: Internet
Author: User

 

When installing PHP, you must set some configuration options, including:
-- With-mysql [= dir]: Contains MySQL extensions. [= dir] specifies the MySQL installation directory. If [= dir] is omitted, the default location is/usr.
-- With-mysqli [= file]: contains the mysqli extension. [= file] specifies the location of the mysql_config file. If [= file] is omitted, the default location is/usr/bin/mysql_config.

-- With-PDO-mysql [= dir]: Contains PDO: MySQL extension. [= dir] specifies the MySQL installation directory. If [= dir] is omitted, the default location is/usr.
-- With-apxs2 [= file]: compiled to the apahce2 shared module, [= file] specifies the location of The apache2 apxs file. If [= file] is omitted, the default location is/usr/sbin/apxs.
Several other options, because I used the RPM package to install MySQL, so I want to know the default installation directory of MySQL, and some files (Lib, include, bin, data) to view the following information.
Below is a post of Cu. Please refer:

[RPM installation path] default installation path of MySQL RPM package

Ask experts to help me solve a problem. because I installed the RPM package and failed to specify the path as the source code file was installed, I found a lot on the Internet and said that in the/usr/local/MySQL path, however, I check that it is not stored, so I want to use the header file and library function of the API provided by MySQL to install it by default? That is, the installed MySQL and directory (including Bin, Data, include, lib ...) Where?

During installation, you can specify the path-Prefix =/usr/local/MySQL

Now you can use rpm-QL MySQL to check

Learn to use man

Man rpm

When I use rpm-QL to query data, how can I prompt that the data has not been installed? I can connect to MySQL normally. How can this happen? How can I know where it is installed?

Or to which directory should I unmount it?

Rpm-Qa | grep MySQL

If not, it means that you are not using RPM to install MySQL.

I found it using rpm-Qa | grep-I mysql. That's right. I have installed those RPM packages and can communicate normally. Now I cannot find the MySQL root directory (including Bin, data, include, lib ...), I want to know where all the APIS provided by MySQL are!

What should we do?

Find bin include lib

Find/-name mysql. H-print

Find/-name libmysqlclient. So-print

Find/-name mysql-print

View data

Mysql> show variables; // datadir

Found! Thank you so much!

The find command is quite useful!

It seems that the RPM package installs the subdirectories in the corresponding directories, but the root directory does not exist.

As you can see in the above post, When you install with rpm, the subdirectories in MySQL are dispersed and placed in the following directories:
(Rhel5.4 RPM install MySQL)
[Root @ rhel5 ~] # Find/-name mysql-print
/Etc/logrotate. d/MySQL
/Etc/rc. d/init. d/MySQL
/Var/lib/MySQL
/Var/lib/MySQL
/Var/lock/subsys/MySQL
/Usr/lib/MySQL
/Usr/include/MySQL
/Usr/share/MySQL
/Usr/bin/MySQL
Data is stored in/var/lib/MySQL by default.

MySQL is installed in/usr/share/MySQL by default.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.