MySQL Development Advanced Series 30 Database binary package (installation specified path, directory description)

Source: Internet
Author: User

I. Specifying a path

In the previous article, the binary package was unzipped, all put in the/usr/local/mysql directory, at the time of installation to specify the base directory and data directory,--basedir=/usr/local/mysql--datadir=/usr/local/mysql/ Data.

-- Some files are installed, there is no path specified, after installation the default distribution is as follows:     error message file and character set file (share/MySQL).    my.cnf (/etc/my.cnf).    socket=/var/lib/mysql/mysql.sock.
Configuration in--my.cnf [Mysqld_safe] log
-error=/var/log/mariadb/mariadb.log pid-file =/var/run/mariadb/mariadb.pid.
-- Check the resources on the Internet, you can specify the path as follows when installing: [[email protected] bin]#. /mysqld  
--defaults-File

--log-error=/var/log/mariadb/mariadb.log
--pid-file=/var/run/mariadb/mariadb.pid
--initialize--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data

Linux is recommended for third-party software under/OPT. Official website Document Initializing The Data Directory manually Using mysqld

Two. MySQL Binary installation directory

Binary installation directory

RPM Installation directory

Binary Directory Description

Bin client program and MYSQLD server

/usr/bin (client programs and scripts)
/usr/sbin (mysqld server)

/usr/local/mysql/bin

In the previous article in the "seven login MySQL" to do a file mapping.

Ln-s/usr/local/mysql/bin/mysql/usr/bin

Data log files and file

/var/lib/mysql (log files and databases)

Here the installation is customized under/usr/local/mysql/data.

Docs Documents and Changelog

/usr/local/mysql/docs

Include (header) file Lib (library file)

/usr/local/mysql/include,/usr/local/mysql/lib

Share/mysql error message file and character set file

/usr/share/mysql (default path)

Three. Login error after rebooting the system
--~]#  mysql-u root-2002 (HY000): Can'/tmp/mysql.sock ' (2)

Workaround:

1. Specify Socket=/tmp/mysql.sock in MY.CNF

2. Start MySQL

[[Email protected] ~]# service MySQL start
Starting MySQL. success!

3. Log in to MySQL OK again

[Email protected] ~]# mysql-u root-p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 2

Server version:5.7.23 MySQL Community Server (GPL)

MySQL Development Advanced Series 30 Database binary package (installation specified path, directory description)

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.