無法在 Ubuntu 中運行 mysqld

無法在 Ubuntu 中運行 mysqld

我嘗試運行 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/mysqlsudo chown -R mysql /var/lib/mysql出現錯誤:

chown: invalid user: ‘mysql’

我正在嘗試學習 Ubuntu/Linux,所以這是我在這個系統中邁出的第一步。

答案1

嘗試以 root 身分執行命令(使用sudo

sudo systemctl start mysql

並確認它已開始嘗試運行

sudo systemctl status mysql

相關內容