我正在使用Ubuntu来配置WSL上的WordPress。目前,我正在尝试安装MySQL作为LAMP堆栈的一部分,使用以下this tutorial:
sudo usermod -d /var/lib/mysql/ mysql
sudo service mysql start
当我运行第二个命令时,我看到出现红色的“fail”(即mysql不会启动)。
2021-09-05T08:17:59.936284Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2021-09-05T08:17:59.951837Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory)
2021-09-05T08:17:59.962000Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161)
2021-09-05T08:17:59.962006Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000)
2021-09-05T08:18:00.172509Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-09-05T08:18:00.172578Z 0 [ERROR] [MY-010095] [Server] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
2021-09-05T08:18:00.172626Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-09-05T08:18:00.178880Z mysqld_safe mysqld from pid file /run/mysqld/mysqld.pid ended
编辑-以下是我运行以下命令时得到的结果:
root@DESKTOP-P44T17P:~# stat /var/lib/mysql-files
stat: cannot stat '/var/lib/mysql-files': No such file or directory
root@DESKTOP-P44T17P:~# grep user /etc/mysql/mysql.conf.d/mysqld.cnf
user = mysql
看起来mysql-files目录不存在。
Ubuntu 20.04.2版本
2条答案
按热度按时间soat7uwm1#
这可能是你日志文件夹由于某种原因被删除了。确保有/var/log/mysql文件夹。如果没有,就用mysql所有权创建一个新的文件夹。
lnlaulya2#
确保目录/var/lib/mysql-files存在并且MySQL应该启动。您可以尝试:
sudo mkdir /var/lib/mysql文件