3

what happens if I use this command?

sudo dpkg-reconfigure mysql-server

and more important : what happens to my databases? Are they droped?

note: when I upgraded my ubuntu 16.04 in last night , changed some settings that I modified , then I can't connect to mysql when I try to connect db, i see this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Thanks!

1
  • No, they are not dropped. Is the mysql server running? For what version have you upgrade it? What version had you before? Have you the DB in a not standard location besides /var/lib/mysql? Please add to the post. (custom mysql configurations are not changed by default in a upgrade unless you change the default n answer to y when asked) Commented Jul 31, 2016 at 8:37

1 Answer 1

1

A sudo dpkg-reconfigure mysql-server will "reconfigure" the MySQL package, asking more questions if to perform the action if it deems they are lacking. Normally running it in a properly installed and configure system is harmless. It is not supposed to drop any database.

It seems your MySQL service is not up.

Ubuntu 16.04 already comes with MySQL 5.7; that version has significant differences from the previous MySQL versions in several aspects, including in the configuration files.

If you are upgrading previous MySQL versions in place, or getting their configuration files, or following old tuning tutorials/scripts, MySQL might not boot due to invalid parameters.

I recommend seeing log messages, in /var/log to see which errors MySQL is giving.

In my case, I had to delete the following configurations from my MySQL servers:

key_buffer             = 16M
myisam-recover         = BACKUP

As a last note, I would stress MySQL 5.7 appears also to be not so forgiving about errors in the MySQL files as previous versions.

To sum it up; check MySQL is running; if not restart it and go check the logs for errors; correct them, and restart MySQL as many times as necessary until the service is running.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.