Starting MySQL.The server quit without updating PID file (/data/soft/mysql-8.0.16-linux-glibc2.12-x8

 这里写一个重置linux mysql 数据库的一套操作,非必要条件下,建议不要使用,或者使用前请做好数据备份,或者请深入研究mysql避免这样的操作。

删除 mysql 根目录下的data 文件夹下的所有数据,重置MySQL

  612  rm -rf ./*
  613  cd ..
  615  cd bin/
  617  mysqld --initialize --user=mysql
  618  mysql_ssl_rsa_setup
  619  cp support-files/mysql.server /etc/init.d/mysql
  620  cd ..
  622  cp support-files/mysql.server /etc/init.d/mysql
  623  chkconfig --add mysql
  624  source /etc/profile
  625  service mysql start
  626  mysql -u root -p

 

其他的如修改密码,请参考我的另一篇博文:https://blog.csdn.net/shunzi2016/article/details/9052223

另外附上基础简单的linux  mysql 的my.cof

[client]
port=3306 # 设置mysql客户端连接服务端时默认使用的端口

default-character-set=utf8
socket=/data/soft/mysql-8.0.12-el7-x86_64/data/mysql.sock



[mysqld]

basedir=/data/soft/mysql-8.0.16-linux-glibc2.12-x86_64 # 设置mysql的安装目录
datadir=/data/soft/mysql-8.0.16-linux-glibc2.12-x86_64/data

socket=/data/soft/mysql-8.0.16-linux-glibc2.12-x86_64/data/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/data/log/mysql-log/error.log
pid-file=/data/soft/mysql-8.0.16-linux-glibc2.12-x86_64/data/mysql.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千码君2016

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值