Make Mysql listening to all ports Ubuntu 22.04

Make Mysql listening to all ports Ubuntu 22.04

次のようなコードがあります:

[mysqld]

bind-address = 0.0.0.0
default-storage-engine = innodb
innodb file per table
collation-server = utf8 general ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

これは古いバージョンの Ubuntu 用です。現在、Ubuntu 22.04 を使用しており、これを動作させようとしています。これを「/etc/mysql/conf.d」ディレクトリに置こうとしていますが、このバージョンの Ubuntu ではその場所ではないと思います。

I put the code and when I am trying to restart the service is throwing the error:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.

The error that the "systemctl status mysql.service" is giving is:

× mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-06-12 14:07:46 UTC; 6s ago
    Process: 19824 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
        CPU: 34ms

Jun 12 14:07:46 controller systemd[1]: Failed to start MySQL Community Server.
Jun 12 14:07:46 controller systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Jun 12 14:07:46 controller systemd[1]: Stopped MySQL Community Server.
Jun 12 14:07:46 controller systemd[1]: mysql.service: Start request repeated too quickly.
Jun 12 14:07:46 controller systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 12 14:07:46 controller systemd[1]: Failed to start MySQL Community Server.

Do you have any suggestion?

答え1

I found out what was the error, it was actually a typo error in the above code, instead of writing:

[mysqld]

bind-address = 0.0.0.0
default-storage-engine = innodb
innodb file per table
collation-server = utf8 general ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

I should have wrote:

[mysqld]

bind-address = 0.0.0.0
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

関連情報