# mysql / mariadb will not start



## Catie (Feb 14, 2020)

I installed mariadb in a jail and was working but now it will not start. I don't care about the data, i'm learning.
what I did:
spin up new jail
pkg install mariadb104-server : no errors
service mysql-server start : installs in /var/db/mysql
service mysql-server status
mysql is not running
service mysql-server start
service mysql-server status
mysql is not running
mysql -u root -p
error 2002 (hy000): can't connect to local mysql server through socket '/tmp/mysql.sock'
obviously, it's not running
deets:
i've done
pkg remove mariadb104-server : no errors
pkg autoremove : no errors
rm -r /var/db/mysql
reinstalled mariadb
no my.cnf file to edit
"/var/.../database test.err" shows "...mysqld: too many arguments (first extra is 'test.pid')."
but there is no my.cnf file to fix


----------



## balanga (Feb 15, 2020)

I just tried this to see what I got...

```
pkg installsy -y mariadb104-server
sysrc mysql_enable=YES
service mysql-server status
```

This resulted in:-


> mysql is running as pid 1053.



That's all I did, and think that is all that is required.

I suspect you have something like a mysql.sock hanging around in /tmp preventing mysql from starting.

Check /var/db/mysql/Mysql.err. It may give you some clues.


----------



## Catie (Feb 15, 2020)

got it figured out, the hostname wasn't correct


----------

