设为首页 收藏本站
查看: 718|回复: 0

[经验分享] Installing MySQL on Unix/Linux Using Generic Binaries-12213582

[复制链接]

尚未签到

发表于 2018-10-11 09:39:15 | 显示全部楼层 |阅读模式
  wget http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
  =================
  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.gzextension) 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. For other platform-specific package formats, see the other platform-specific sections. For example, for Windows distributions, see Section 2.3, “Installing MySQL on Microsoft Windows”.
  To obtain MySQL, see Section 2.1.2, “How to Get MySQL”.
  MySQL compressed tar file binary distributions have names of the form mysql-VERSION-OS.tar.gz, where VERSION is a number (for example, 5.7.18), and OS indicates the type of operating system for which the distribution is intended (for example, pc-linux-i686 or winx64).
  Warning
  If you have previously installed MySQL using your operating system native package management system, such as yum or apt-get, 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>  Warning
  MySQL has a dependency on the libaio library. Data directory initialization and subsequent server startup steps will fail if this library is not installed locally. If necessary, install it using the appropriate package manager. For example, on Yum-based systems:
shell> yum search libaio  # search for info  
shell> yum install libaio # install library
  Or, on APT-based systems:
shell> apt-cache search libaio # search for info  
shell> apt-get install libaio1 # install library
  If you run into problems and need to file a bug report, please use the instructions in Section 1.7, “How to Report Bugs or Problems”.
  On Unix, 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.
  Table 2.3 MySQL Installation Layout for Generic Unix/Linux Binary Package
DirectoryContents of Directorybin, scriptsmysqld server, client and utility programsdataLog files, databasesdocsMySQL manual in Info formatmanUnix manual pagesincludeInclude (header) fileslibLibrariesshareMiscellaneous support files, including error messages, sample configuration files, SQL for database installation  

  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.9, “Installing MySQL from Source”.
  To install and use a MySQL binary distribution, the command sequence looks like this:
shell> groupadd mysqlshell> useradd -r -g mysql -s /bin/false mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> mkdir mysql-filesshell> chmod 750 mysql-filesshell> chown -R mysql .shell> chgrp -R mysql .shell> scripts/mysql_install_db --user=mysql# MySQL 5.7.0 to 5.7.4  
shell> bin/mysql_install_db --user=mysql    # MySQL 5.7.5
  
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up
  
shell> bin/mysql_ssl_rsa_setup              # MySQL 5.7.6 and up
  
shell> chown -R root .shell> chown -R mysql data mysql-filesshell> bin/mysqld_safe --user=mysql &# Next command is optional
  
shell> cp support-files/mysql.server /etc/init.d/mysql.server
  Note
  This procedure assumes that you have root (administrator) access to your system.>sudo (Linux) or pfexec (OpenSolaris) command.
  Note
  Before MySQL 5.7.4, the procedure does not assign passwords to MySQL accounts. To do so, use the instructions in Section 2.10.4, “Securing the Initial MySQL Accounts”.
  The mysql-files directory provides a convenient location to use as the value of the secure_file_priv system variable that limits import/export operations to a specific directory. See Section 6.1.5, “Server System Variables”.
  Before MySQL 5.7.5, mysql_install_db creates a default option file named my.cnf in the base installation directory. This file is created from a template included in the distribution package named my-default.cnf. For more information, see Section 6.1.2, “Server Configuration Defaults”.
  Note
  As of MySQL 5.7.18, my-default.cnf is no longer included in or installed by distribution packages.
  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 one. The following commands add the mysqlgroup 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, or they may have different names such asadduser and addgroup.
shell> groupadd mysqlshell> useradd -r -g mysql -s /bin/false mysql  Note
  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 useradddoes not support them.
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.
shell> cd /usr/local
  Obtain a distribution file using the instructions in Section 2.1.2, “How to Get MySQL”. For a given>  Unpack the distribution, which creates the installation directory. tar can uncompress and unpack the distribution if it has z option support:
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz  The tar command creates a directory named mysql-VERSION-OS.
  To install MySQL from a compressed tar file binary distribution, your system must have GNU gunzip to uncompress the distribution and a reasonable tarto unpack it. If your tar program supports the z option, it can both uncompress and unpack the file.
  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 have z option support, use gunzip to unpack the distribution and tar to unpack it. Replace the preceding tar command with the following>shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -  Next, create a symbolic link to the installation directory created by tar:
shell> 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 PATHvariable:
shell> export PATH=$PATH:/usr/local/mysql/binPerform 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.10, “Postinstallation Setup and Testing”.
  转自:http://dev.mysql.com/doc/refman/5.7/en/binary-installation.html#binary-installation-layout



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-620232-1-1.html 上篇帖子: mysql官网下载源码安装包教程 下篇帖子: mysql相关
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表