debian非root安装MySQL5.7.17 mysqld –initialize 无反应,无法在dat

MySql 码拜 7年前 (2017-05-07) 2993次浏览
非root安装MySQL
执行mysqld –inistialize 没有反应,只创建了data文件夹并没有数据。然后执行mysql_safe报错mysqld: Table “mysql.plugin” doesn”t exist
配置文件如下
[client]
port   = 33306
socket = /home/xxx/var/mysql/mysql.sock
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = /home/xxx/local/mysql
datadir = /home/xxx/local/mysql/data
log-error = /home/xxx/var/mysql/logs/mysql_error.log
pid-file = /home/xxx/var/mysql/mysql.pid
port = 33306
user = xxx
lc-messages-dir=/home/xxx/local/mysql/share
启动命令试了好多种都没反应:
大致如下
./bin/mysqld –user=xxx –basedir=/home/gzwangweihao/local/mysql –datadir=/home/gzwangweihao/local/mysql/data –defaults-file=./my.cnf –initialize-insecure
解决方案

30

看启动错误日志
/home/xxx/var/mysql/logs/mysql_error.log

20

ERROR 文件中有初始密码。看一下能否正确。

25

initial 的时候跟配置文件无关,只需要指定 datadir
查下你用的 mysqld  是不是不对, which mysqld

25

连接失败,加个 -h ::1 ,用 tcp 连接,或通过 -S 指定你配置的 sock 文件

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明debian非root安装MySQL5.7.17 mysqld –initialize 无反应,无法在dat
喜欢 (0)
[1034331897@qq.com]
分享 (0)