Smelter
Smelter

Reputation: 11

Unable to restart mysql server installed on Alibaba Cloud ECS?

I have installed MySQL server on Alibaba Cloud ECS instance, I am updating the /etc/mysql/my.cnf with bind-address = 0.0.0.0, after that, I am unable to restart the MySQL service. The below is the error

mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Tue 2018-12-25 16:56:32 IST; 7s ago
  Process: 6905 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 6896 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 6905 (code=exited, status=1/FAILURE);         : 6906 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           └─control
             ├─6906 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─6925 sleep 1

Dec 25 16:56:32 iZa2dej95yv6tb65txtwfhZ systemd[1]: Starting MySQL Community Server...
Dec 25 16:56:32 iZa2dej95yv6tb65txtwfhZ mysql-systemd-start[6896]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 
Dec 25 16:56:32 iZa2dej95yv6tb65txtwfhZ mysql-systemd-start[6896]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
Dec 25 16:56:32 iZa2dej95yv6tb65txtwfhZ systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Upvotes: 0

Views: 144

Answers (3)

Mas Dimas
Mas Dimas

Reputation: 333

Mysql Package maybe was change, testing to change on /etc/mysql/mysql.conf.d/mysqld.cnf, change or remove bind on /etc/mysql/my.cnf

Upvotes: 0

Ranjith Udayakumar
Ranjith Udayakumar

Reputation: 420

Setting bind address to "0.0.0.0" tells MySQL to listen to all interfaces. It seems like you want to access MySQL remotely if I am not wrong. If so then you can simply comment out the bind-address and restart it will work fine.

Some MySQL packaged versions would have startup | maintenance scripts which will attempt to access MySQL on default address (127.0.0.1). Even it may be the cause or you may have another bind-address parameter unknowingly.

So better to comment it out, restart the MySQL again.

Upvotes: 0

Carlos
Carlos

Reputation: 1431

It seems to be some syntax problem or may be an encoding problem. Please check this

Upvotes: 0

Related Questions