MySQL8.0 二进制安装

安装前的一些说明:

  检查平台兼容性:

   https://www.mysql.com/support/supportedplatforms/ database.html  

  如果是在RedHat7版本安装的话,可以先卸载自带的MySQL版本。  

  通过以下命令查看系统是否预安装了MariaDB:

  shell> rpm -qa | grep mariadb

  通过以下命令删除预安装的MariaDB:

  shell> rpm -e --nodeps mariadb-server mariadb-libs

  验证包的完整性以及是否被篡改:

扫描二维码关注公众号,回复: 9146598 查看本文章

  shell> md5sum mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz

  或者

  shell> openssl md5 mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz

  对比该校验和与MySQL下载项页面下的校验和是否相同

  MySQL依赖libaio库,如果本地没有安装该库的话,后面的数据目录初始化及MySQL服务器启动会失败。

  安装libaio库:

  shell> yum search libaio  # search for info

  shell> yum install libaio # install library

  注:官档中只是安装了libaio包,在实际安装MySQL过程中,还需要安装libaio的开发文件包:libaio-devel

  shell> yum install libaio-devel

  补充:在RedHat 8中,默认没有安装/lib64/libtinfo.so。该文件是在MySQL二进制安装下使用MySQL 客户端时需要的。

  可以通过下面命令安装需要的包解决:

  shell> yum install ncurses-compat-libs

下面是安装过程的简单介绍:

  解压tar包到选择的位置。

  安装和使用MySQL二进制发行版,命令顺序如下:

  shell> groupadd mysql

  shell> useradd -r -g mysql -s /bin/false mysql

  shell> cd /usr/local

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

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

  shell> cd mysql

  shell> mkdir mysql-files

  shell> chown mysql:mysql mysql-files

  shell> chmod 750 mysql-files

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

  shell> bin/mysql_ssl_rsa_setup

  shell> bin/mysqld_safe --user=mysql & # Next command is optional

  shell> cp support-files/mysql.server /etc/init.d/mysql.server

  

猜你喜欢

转载自www.cnblogs.com/xinzhizhu/p/12306836.html