Install mysql tar in linux

Install mysql tar in linux

MySQL 5.7 Reference Manual Including MySQL NDB Cluster 7.5 and NDB Cluster 7.6

2.5.6 Installing MySQL on Linux Using Debian Packages from Oracle

Oracle provides Debian packages for installing MySQL on Debian or Debian-like Linux systems. The packages are available through two different channels:

  • The MySQL APT Repository. This is the preferred method for installing MySQL on Debian-like systems, as it provides a simple and convenient way to install and update MySQL products. For details, see Section 2.5.3, “Installing MySQL on Linux Using the MySQL APT Repository”.
  • The MySQL Developer Zone’s Download Area. For details, see Section 2.1.3, “How to Get MySQL”. The following are some information on the Debian packages available there and the instructions for installing them:
  • Various Debian packages are provided in the MySQL Developer Zone for installing different components of MySQL on different Debian or Ubuntu platforms. The preferred method is to use the tarball bundle, which contains the packages needed for a basic setup of MySQL. The tarball bundles have names in the format of mysql-server_ MVERDVER _ CPU .deb-bundle.tar . MVER is the MySQL version and DVER is the Linux distribution version. The CPU value indicates the processor type or family for which the package is built, as shown in the following table:
CPU Value Intended Processor Type or Family
i386 Pentium processor or better, 32 bit
amd64 64-bit x86 processor
$> tar -xvf mysql-server_MVER-DVER_CPU.deb-bundle.tar 
$> sudo apt-get install libaio1 
$> sudo dpkg-preconfigure mysql-community-server_*.deb 

You are asked to provide a password for the root user for your MySQL installation. You might also be asked other questions regarding the installation.

Make sure you remember the root password you set. Users who want to set a password later can leave the password field blank in the dialogue box and just press OK ; in that case, root access to the server is authenticated using the MySQL Socket Peer-Credential Authentication Plugin for connections using a Unix socket file. You can set the root password later using mysql_secure_installation .

$> sudo dpkg -i mysql-_*.deb 

If you are being warned of unmet dependencies by dpkg , you can fix them using apt-get :

sudo apt-get -f install
  • All configuration files (like my.cnf ) are under /etc/mysql
  • All binaries, libraries, headers, etc., are under /usr/bin and /usr/sbin
  • The data directory is /var/lib/mysql
Читайте также:  Alder lake linux kernel

Debian distributions of MySQL are also provided by other vendors. Be aware that they may differ from those built by Oracle in features, capabilities, and conventions (including communication setup), and that the instructions in this manual do not necessarily apply to installing them. The vendor’s instructions should be consulted instead.

Источник

Install mysql tar in linux

Oracle provides a set of binary distributions of MySQL. These include generic binary distributions in the form of compressed tar files (files with a .tar.xz extension) for a number of platforms, and binaries in platform-specific package formats for selected platforms.

This section covers the installation of MySQL from a compressed tar file binary distribution on Unix/Linux platforms. For Linux-generic binary distribution installation instructions with a focus on MySQL security features, refer to the Secure Deployment Guide. For other platform-specific binary package formats, see the other platform-specific sections in this manual. For example, for Windows distributions, see Section 2.3, “Installing MySQL on Microsoft Windows”. See Section 2.1.3, “How to Get MySQL” on how to obtain MySQL in different distribution formats.

MySQL compressed tar file binary distributions have names of the form mysql- VERSIONOS .tar.xz , where VERSION is a number (for example, 8.0.33 ), and OS indicates the type of operating system for which the distribution is intended (for example, pc-linux-i686 or winx64 ).

There is also a “ minimal install ” version of the MySQL compressed tar file for the Linux generic binary distribution, which has a name of the form mysql- VERSIONOSGLIBCVERARCH -minimal.tar.xz . The minimal install distribution excludes debug binaries and is stripped of debug symbols, making it significantly smaller than the regular binary distribution. If you choose to install the minimal install distribution, remember to adjust for the difference in file name format in the instructions that follow.

  • If you have previously installed MySQL using your operating system native package management system, such as Yum or APT, you may experience problems installing using a native binary. Make sure your previous MySQL installation has been removed entirely (using your package management system), and that any additional files, such as old versions of your data files, have also been removed. You should also check for configuration files such as /etc/my.cnf or the /etc/mysql directory and delete them. For information about replacing third-party packages with official MySQL packages, see the related APT guide or Yum guide.
  • MySQL has a dependency on the libaio library. Data directory initialization and subsequent server startup steps fail if this library is not installed locally. If necessary, install it using the appropriate package manager. For example, on Yum-based systems:
$> yum search libaio # search for info $> yum install libaio # install library
$> apt-cache search libaio # search for info $> apt-get install libaio1 # install library
$> yum install ncurses-compat-libs 

To install a compressed tar file binary distribution, unpack it at the installation location you choose (typically /usr/local/mysql ). This creates the directories shown in the following table.

Читайте также:  Kali linux custom image downloads offensive security

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

Debug versions of the mysqld binary are available as mysqld-debug . To compile your own debug version of MySQL from a source distribution, use the appropriate configuration options to enable debugging support. See Section 2.8, “Installing MySQL from Source”.

To install and use a MySQL binary distribution, the command sequence looks like this:

$> groupadd mysql $> useradd -r -g mysql -s /bin/false mysql $> cd /usr/local $> tar xvf /path/to/mysql-VERSION-OS.tar.xz $> ln -s full-path-to-mysql-VERSION-OS mysql $> cd mysql $> mkdir mysql-files $> chown mysql:mysql mysql-files $> chmod 750 mysql-files $> bin/mysqld --initialize --user=mysql $> bin/mysql_ssl_rsa_setup $> bin/mysqld_safe --user=mysql & # Next command is optional $> cp support-files/mysql.server /etc/init.d/mysql.server 

This procedure assumes that you have root (administrator) access to your system. Alternatively, you can prefix each command using the sudo (Linux) or pfexec (Solaris) command.

The mysql-files directory provides a convenient location to use as the value for the secure_file_priv system variable, which limits import and export operations to a specific directory. See Section 5.1.8, “Server System Variables”.

A more detailed version of the preceding description for installing a binary distribution follows.

Create a mysql User and Group

If your system does not already have a user and group to use for running mysqld , you may need to create them. The following commands add the mysql group and the mysql user. You might want to call the user and group something else instead of mysql . If so, substitute the appropriate name in the following instructions. The syntax for useradd and groupadd may differ slightly on different versions of Unix/Linux, or they may have different names such as adduser and addgroup .

$> groupadd mysql $> useradd -r -g mysql -s /bin/false mysql 

Because the user is required only for ownership purposes, not login purposes, the useradd command uses the -r and -s /bin/false options to create a user that does not have login permissions to your server host. Omit these options if your useradd does not support them.

Читайте также:  How to launch program in linux

Obtain and Unpack the Distribution

Pick the directory under which you want to unpack the distribution and change location into it. The example here unpacks the distribution under /usr/local . The instructions, therefore, assume that you have permission to create files and directories in /usr/local . If that directory is protected, you must perform the installation as root .

Obtain a distribution file using the instructions in Section 2.1.3, “How to Get MySQL”. For a given release, binary distributions for all platforms are built from the same MySQL source distribution.

Unpack the distribution, which creates the installation directory. tar can uncompress and unpack the distribution if it has z option support:

$> tar xvf /path/to/mysql-VERSION-OS.tar.xz 

The tar command creates a directory named mysql- VERSIONOS .

To install MySQL from a compressed tar file binary distribution, your system must have GNU XZ Utils to uncompress the distribution and a reasonable tar to unpack it.

The compression algorithm changed from Gzip to XZ in MySQL Server 8.0.12; and the generic binary’s file extension changed from .tar.gz to .tar.xz.

GNU tar is known to work. The standard tar provided with some operating systems is not able to unpack the long file names in the MySQL distribution. You should download and install GNU tar , or if available, use a preinstalled version of GNU tar. Usually this is available as gnutar , gtar , or as tar within a GNU or Free Software directory, such as /usr/sfw/bin or /usr/local/bin . GNU tar is available from http://www.gnu.org/software/tar/.

If your tar does not support the xz format then use the xz command to unpack the distribution and tar to unpack it. Replace the preceding tar command with the following alternative command to uncompress and extract the distribution:

$> xz -dc /path/to/mysql-VERSION-OS.tar.xz | tar x 

Next, create a symbolic link to the installation directory created by tar :

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

The ln command makes a symbolic link to the installation directory. This enables you to refer more easily to it as /usr/local/mysql . To avoid having to type the path name of client programs always when you are working with MySQL, you can add the /usr/local/mysql/bin directory to your PATH variable:

$> export PATH=$PATH:/usr/local/mysql/bin 

Perform Postinstallation Setup

The remainder of the installation process involves setting distribution ownership and access permissions, initializing the data directory, starting the MySQL server, and setting up the configuration file. For instructions, see Section 2.9, “Postinstallation Setup and Testing”.

Источник

Оцените статью
Adblock
detector