Mariadb binary logging unable to start mysql

I succesfully installed Nextcloud but after restarting my machine mysql stopped working, when I tried to access my nextcloud server via browser it gave me an http error 500 and when I tried "mysql start I got the following error:

mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 23!
mysql: [ERROR] Fatal error in defaults handling. Program aborted!

The error was caused by these three lines I added to the /etc/mysql/my.cnf:

log-bin = /var/log/mysql/mariadb-bin
log-bin-index = /var/log/mysql/mariadb-bin.index
binlog_format = mixed

without these three lines, nextcloud is working.

Is there any way to fix this error?

It is an mysql error: