我尝试运行 mysqld 但在 Ubuntu 终端中出现以下错误。
2022-08-30T18:48:34.596763Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2022-08-30T18:48:34.596796Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30-0ubuntu0.22.04.1) starting as process 2510
2022-08-30T18:48:34.597987Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2022-08-30T18:48:34.597992Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2022-08-30T18:48:34.602565Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-30T18:48:34.602646Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.22.04.1) (Ubuntu).
当我尝试/var/lib/mysql
通过以下方式更改路径权限时sudo chown -R mysql /var/lib/mysql
出现错误:
chown: invalid user: ‘mysql’
我正在尝试学习 Ubuntu/Linux,因此这是我在这个系统中迈出的第一步。
答案1
尝试以 root 身份运行命令(使用sudo
)
sudo systemctl start mysql
为了确认它已经开始,请尝试运行
sudo systemctl status mysql