Install MySQL in linux
Since Oracle has acquired MySQL, the commercial version has also been transferred to the edelivery.oracle.com website. You can download the study by yourself, but you must first register an account for the Oracle website.
If you download the GA version, that is, the Community version, you can download it directly at http://dev.mysql.com/downloads/mysql/website.
To download the old version of MySQL, you can also find it at http://dev.mysql.com/downloads/mysql/website. Only 5.1.73and 5.5.40 can be downloaded. Users who need it can download it by themselves.
Note: Only packages installed using rpm are available.
RPM Bundle downloads MySQL-related packages for emergency purposes.
Download and upload the package to the mysql server. decompress the package and run the rpm command to install the package.
Note that the initial mysql password is at/root/. mysql_secret, which is easy to ignore and is used for the First Login by the root user.
Note that:
After rpm is installed, a mysql group and users are added to the operating system.
Initial file directory:
Directory |
Contents of Directory |
/Usr/bin |
Client programs and scripts |
/Usr/sbin |
TheMysqldServerMySQL |
/Var/lib/mysql |
Log files, databases |
/Usr/share/info |
Manual in Info format |
/Usr/share/man |
Unix manual pages |
/Usr/include/mysql |
Include (header) files |
/Usr/lib/mysql |
Libraries |
/Usr/share/mysql |
Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation |
/Usr/share/SQL-Example |
Benchmarks |
After rpm is installed, you can directly use the service mysql start command to start the mysql database.
After the startup, the ps command is used to view its startup options.
/Usr/sbin/mysqld -- basedir =/usr -- datadir =/var/lib/mysql -- plugin-dir =/usr/lib/mysql/plugin -- user = mysql -- log- error =/var/lib/mysql/mysql01.err -- pid-file =/var/lib/mysql/mysql01.pid
-- Basedir =/usr root directory
-- Datadir =/var/lib/mysql data file storage directory
-- Plugin-dir =/usr/lib/mysql/plugin directory
-- User = mysql startup user
-- Log-error =/var/lib/mysql/mysql01.err error log File path
-- Pid-file =/var/lib/mysql/mysql01.pid process id file storage location
The default option is the above. modify it in the/etc/init. d/mysql STARTUP script or my. cnf file.
The default my. cnf search directory is
$ BASEDIR/my. cnf ----/etc/my. cnf