- 查询glib版本
[hadoop@node4 install]$ ldd --version ldd (GNU libc) 2.17 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.
2.官网下载Mysql安装包
https://downloads.mysql.com/archives/community/
3.新建配置文件vim /etc/my.cnf [mysqld] #端口号 port = 3307 #操作系统用户 user = root #开启log_bin,非必要可以不开 server_id=2 log_bin = mysql-bin binlog_format = ROW #字符集 character_set_server = utf8mb4 #存储引擎 default-storage-engine = INNODB #密码插件 default_authentication_plugin = mysql_native_password #非严格模式 sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' #数据文件路径 datadir = /data/appcom/install/mysql/data #安装文件路径 basedir = /data/appcom/install/mysql #连接文件路径 socket = /data/appcom/install/mysql/mysql.sock #日志文件路径 log-error = /data/appcom/install/mysql/logs/mysqld.logs explicit_defaults_for_timestamp = true #最大连接数 max_connections = 200 #最大错误数 max_connect_errors = 10 [client] #客户端默认端口 port = 3307 #客户端默认字符集 default-character-set = utf8mb4 4.安装初始化 ```bash #解压安装文件 tar -xvf mysql-8.0.37-linux-glibc2.17-x86_64.tar.xz #创建数据文件目录、日志文件目录 mkdir -p /data/appcom/install/mysql/data mkdir -p /data/appcom/install/mysql/logs #初始化 /data/appcom/install/mysql/bin/mysqld --defaults-file=/data/appcom/install/mysql/conf/my.cnf --initialize --console #检查日志及查看密码 more /data/appcom/install/mysql/logs/mysqld.logs #启动服务 /data/appcom/install/mysql/bin/mysqld --defaults-file=/data/appcom/install/mysql/conf/my.cnf #客户端连接 /data/appcom/install/mysql/bin/mysql -u root -P 3307 -p --socket=/data/appcom/install/mysql/mysql.sock #修改密码 use mysql; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; #允许远程登录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; #刷新权限 FLUSH PRIVILEGES; #新建测试用户 create user 'streamis_test'@'%' identified by 'streamis_test'; #新建数据库 CREATE DATABASE streamis_test DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; #授权 use streamis_test; grant all privileges on streamis_test to 'streamis_test'@'%'; grant all on streamis_test.* to streamis_test@'%'; GRANT SELECT,REPLICATION SLAVE,REPLICATION CLIENT ON *.* TO 'streamis_test'@'%'; #查看权限 show grants for streamis_test@'%';