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)