首页 > 数据库 >MySQL安装

MySQL安装

时间:2023-12-26 16:34:48浏览次数:41  
标签:bin log 安装 MySQL usr mysql local logs

安装

tar -zxvf mysql-5.7.43-el7-x86_64.tar.gz -C /usr/local/
cd /usr/local
mv mysql-5.7.43-el7-x86_64 mysql
cd /usr/lcoal/mysql
groupadd mysql
useradd -r -M -g mysql mysql
chown -R mysql:mysql ./

创建目录

mkdir /data
mkdir /data/mysql

备份并修改配置文件

cp /etc/my.cnf /etc/my.cnf.default.bak

vi /etc/my.cnf

修改配置文件

[mysqld]
socket=/usr/local/mysql/mysql.sock
user=mysql
symbolic-links=0
datadir=/data/mysql
pid-file=/usr/local/mysql/mysqld.pid
innodb_file_per_table=1

log-slave-updates = on

log-error=/usr/local/mysql/logs/mysql.err
log-bin=/usr/local/mysql/logs/mysql-bin
log-bin-index=/usr/local/mysql/logs/mysql-bin.index
relay-log=/usr/local/mysql/logs/relay-bin
relay-log-index=/usr/local/mysql/logs/relay-bin.index
binlog-do-db = zcms

innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50

character-set-server=utf8
max_connections=20000

long_query_time = 1
slow_query_log=1
slow_query_log_file=/usr/local/mysql/logs/mysql-slow.log
expire_logs_days=7
query_cache_type = 1
query_cache_size = 10M

server-id=1
sync-binlog=1
lower_case_table_names=1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[client]
port=3306
socket=/usr/local/mysql/mysql.sock

[mysqld_safe]
log-error=/usr/local/mysql/logs/mysqld.log
pid-file=/usr/local/mysql/mysqld.pid

初始化

./bin/mysqld --initialize --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql

报错

2023-12-26T08:27:15.600641Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-12-26T08:27:15.600750Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2023-12-26T08:27:15.600758Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2023-12-26T08:27:15.605611Z 0 [ERROR] Could not open file '/usr/local/mysql/logs/mysql.err' for error logging: No such file or directory
2023-12-26T08:27:15.605637Z 0 [ERROR] Aborting

新建文件夹

cd /usr/local/logs
mkdir logs
chown -R mysql:mysql ./

密码

cat /usr/local/mysql/logs/mysql.err

标签:bin,log,安装,MySQL,usr,mysql,local,logs
From: https://www.cnblogs.com/zdtiio/p/17928410.html

相关文章

  • [升级] MySQL升级步骤及注意事项
    升级步骤a.备份数据库(包括schema,data,routines(function,triggersetc)b.修复util.checkForZSzerverUpgrade()发现的问题c.添加innodb_fast_shutdown=0来彻底的关闭mysqld.更新mysqlbinaries,可以使用tarball,RMP,mis等注意事项a.从5.7升级到8.0,或者在8.0.x之间升级可以......
  • essbase21c安装
    essbase21c和11有挺大不同的,11需要绑定foundationservice才能安装(或者可以通过biee?没试过)而21C可以单独部署,21C的集群功能只能在linux系统部署,前提是需要安装oraclefusionmiddleware,oracledatabase安装完成后报错,配置时候报错,原因是数据库版本不匹配星期二十二月2615:1......
  • Tomca8.5安装
    Tomca8.5安装安装编译所需要的gccyum-yinstallgcc下载JDKhttps://www.oracle.com/java/technologies/downloads/jdk-8u391-linux-x64.tar.gz安装JDKtarxfjdk-8u171-linux-x64.tar.gzchmod755jdk1.8.0_391mvjdk1.8.0_391/usr/java/配置JDKvi/etc/profile......
  • docker安装RocketMQ
    在RocketMQ中,有三个关键组件:Namesrv(NameServer)、Broker和Console-ng(管理控制台)。Namesrv(NameServer):Namesrv是RocketMQ的命名服务,负责管理整个RocketMQ集群的路由信息。每个RocketMQ集群中都至少需要一个Namesrv实例。它维护了Broker的网络信息、Topic的路由规则以及Consumer的......
  • MySQL
    基础篇转载地址:https://dhc.pythonanywhere.com/article/public/1/#h2-u901Au7528u8BEDu6CD5u53CAu5206u7C7B通用语法及分类DDL:数据定义语言,用来定义数据库对象(数据库、表、字段)DML:数据操作语言,用来对数据库表中的数据进行增删改DQL:数据查询语言,用来查询数据库中表的......
  • virtualbox安装windows10出现OOBE,卡在OOBE。
    参照https://zhuanlan.zhihu.com/p/419237209https://www.0z.gs/win/781.html文档https://learn.microsoft.com/zh-cn/windows-hardware/manufacture/desktop/boot-windows-to-audit-mode-or-oobe?view=windows-11OOBE也就是OutofBoxExperience开箱即用体验。卡在OOBE跳......
  • 2、安装nginx
    1、检查Linux内核版本uname-a内核版本为3.10.0,Linux安装需要内核版本>=2.62、安装依赖环境安装gcc如果已经安装过可以忽略yuminstallgcc安装g++如果已经安装过可以忽略yuminstallgcc-c++安装PCRE库(perlcompatibleregularexpression)如果已经安......
  • Keepalived 安装 配置 Nginx 高可用
    Keepalived安装配置Nginx高可用Keepalived安装yuminstall-ykeepalived配置文件位置/etc/keepalived/keepalived.conf配置nginx高可用vi/etc/keepalived/keepalived.confvrrp_scriptchk_gluster{script"/usr/bin/systemctlis-activeglusterd"int......
  • Ubuntu 安装vmware tools
                                                            Ubuntu安装vmwaretools一、Ubuntu20.0安装vmwaretools,在VCenter平台上选择虚拟机,点击安装VMwa......
  • MySql的information_schema.processlist库学习之"如何检测出大数据sql查询"
    1.如何通过MySql检测出大数据sql查询一般数据库都会存在:information_schema数据库 检测出大数据sql查询[time时间越长说明,数据量越大,要根据公司的限度来衡量,我的思路是500以上都要查看是否是大数据的范畴]2.案例--检测出大数据sql查询[time时间越长说明,数据量越大,要根据......