mysql ERROR: Util.checkForServerUpgrade: Can't connect to local MySQL server through socket

534 views Asked by At

I run on my server mysql in version 5.7.40

mysql --version
mysql  Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using  EditLine wrapper

And generally it works without any issues. I want to upgrade from 5.7.40 to 8.. and because of it I want to use mysql tools to check if it is safe to upgrade. But every time I run command

mysqlsh -- util checkForServerUpgrade root@localhost

I got following error

Cannot set LC_ALL to locale en_US.UTF-8: No such file or directory
Please provide the password for 'root@localhost': **********
ERROR: Util.checkForServerUpgrade: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

How to fix it?

1

There are 1 answers

0
Ajith Daniel On

Seems like socket not there in the default directory (/tmp/mysql.sock)

Try this with port

mysqlsh -- util checkForServerUpgrade root@localhost:3306

OR

Using proper Socket

mysqlsh --socket=/tmp/mysql.sock --user=root -e "util.checkForServerUpgrade()"