MySQL笔记-解决InnoDB: Could not find a valid tablespace file for 'mysql/innodb_index_stats'

这里主要是./mysql_install_db时会出现的。

如下的问题:

这里主要的问题是:my.cnf权限问题,这里文件的权限为777。这是不安全的。

主要是因为my.cnf中的[mysqld]中的datadir找不到。

把权限设置为:644即可

./mysql_install_db --basedir=/u01/mysql3307/ --datadir=/u01/mysql3307/data --defaults-file=/u01/mysql3307/my.cnf

这里要记得记录好环境变量。

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/openssl/bin:$HOME/bin:/u01/mysql3306/bin

export PATH
发布了1358 篇原创文章 · 获赞 1万+ · 访问量 579万+

猜你喜欢

转载自blog.csdn.net/qq78442761/article/details/105759078