Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use binaries to install MySQL

Shulou Source: shulou.com Published: 2022-05-31 18:33:13 11月18日 Update

This article mainly introduces "how to use binary package to install MySQL". In daily operation, I believe many people have doubts about how to use binary package to install MySQL. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to use binary package to install MySQL". Next, please follow the editor to study!

Important tips:

MySQL needs to install libaio,5.7.19 version and libnuma in the future

1 decompress MySQL to the specified path, and this step will create the following directory structure:

Refer to the decompression instructions:

Gunzip

< /path/to/mysql-VERSION-OS.tar.gz | tar xvf - Table 2.3 MySQL Installation Layout for Generic Unix/Linux Binary Package Directory Contents of Directory bin mysqld server, client and utility programs docs MySQL manual in Info format man Unix manual pages include Include (header) files lib Libraries share Error messages, dictionary, and SQL for database installation support-files Miscellaneous support files 2 创建用户和组 此用户和组用于运行mysqld, shell>

Groupadd mysql

Shell > useradd-r-g mysql-s / bin/false mysql #-r means create a system account

3 create symbolic links

Shell > ln-s full-path-to-mysql-VERSION-OS mysql

4 assign to the Path environment variable

Export PATH=$PATH:/usr/local/mysql/bin

5 initialize the data file path

Create a mysql-files folder in the mysql installation path to point to the secure_file_priv parameter and to import / export files

Shell > mkdir mysql-files

Shell > chown mysql:mysql mysql-files

Shell > chmod 750mysql-files

Shell > bin/mysqld-- initialize-- user=mysql

When you execute the initialize command, it is important to note that the owner of data-directory must be mysql, and then add-- user=mysql after initialize.

If mysql cannot know the basedir (installation path) or datadir data file path, use some to specify it.

Shell > bin/mysqld-initialize-user=mysql-basedir=/opt/mysql/mysql-datadir=/opt/mysql/mysql/data

Of course, you can also write to the my.cnf path

[mysqld]

Basedir=/opt/mysql/mysql

Datadir=/opt/mysql/mysql/data

The method of use is as follows

C:\ > bin/mysqld-defaults-file=C:\ my.ini-initialize

After initializing the data directory, start mysql

Bin/mysqld_safe-- user=mysql &

Then, after logging in, the installation of mysql is completed.

At this point, the study on "how to use binaries to install MySQL" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Path binary Lai an file learning data method more user directory help practical important next use method parameter variable command instruction point to Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Information MariaDB Linux vpn