由于不幸,我删除了整个/ var / lib / mysql目录.由于数据库没有包含任何重要内容,因此我不想经历从旧备份恢复它的麻烦,而是从头开始创建目录结构.如何在不重新安装MySQL的情况下执行此操作?
解决方法:
mysql_install_db initializes the MySQL data directory and creates the system tables that it contains, if they do not exist. It also initializes the system tablespace and related data structures needed to manage InnoDB tables. As of MySQL 5.6.8, mysql_install_db is a Perl script and can be used on any system with Perl installed. Before 5.6.8, it is a shell script and is available only on Unix platforms.
试试看 !!!
如果第一次尝试不起作用,请执行此操作
mkdir /var/lib/mysql
mkdir /var/lib/mysql/mysql
chown -R mysql:mysql /var/lib/mysql
标签:linux,mysql,debian
来源: https://codeday.me/bug/20190805/1590623.html