Can't reach mysql server after mariadb upgrade in VM

Please advise:

I updated the VM .ova instance with
sudo apt-get update
sudo apt-get upgrade

the system upgraded the mariadb to v.10.

Now after reboot
run the command:
bench update
with the following result:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow) frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete erpnext_demo
    INFO:bench.utils:git pull upstream develop
    From GitHub - frappe/erpnext_demo: Deprecated with Version 7 (will work till v6)
  • branch develop → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/bench-repo/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext_demo/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Updating node libraries…
    INFO:bench.utils:npm install
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“ia32”})
    npm WARN frappe@ No description
    Backing up sites…
    Traceback (most recent call last):
    File “/usr/lib/python2.7/”, line 162, in _run_module_as_main
    main”, fname, loader, pkg_name)
    File “/usr/lib/python2.7/”, line 72, in _run_code
    exec code in run_globals
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 94, in
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 722, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 697, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 24, in _func
    ret = f(frappe.dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 289, in backup
    odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=True)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 166, in scheduled_backup
    odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 176, in new_backup
    odb.get_backup(older_than, ignore_files, force=force)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 48, in get_backup
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 63, in set_backup_file_name
    todays_date = now_datetime().strftime('%Y%m%d
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 122, in now_datetime
    dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 145, in convert_utc_to_user_timezone
    return utcnow.astimezone(timezone(get_time_zone()))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 139, in get_time_zone
    return frappe.cache().get_value(“time_zone”, _get_time_zone)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 72, in get_value
    val = generator()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 133, in _get_time_zone
    return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’
    File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 859, in get_system_setting
    return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 72, in get_value
    val = generator()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 858, in _load_system_settings
    return self.get_singles_dict(“System Settings”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 543, in get_singles_dict
    tabSingles where doctype=%s"“”, doctype))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 121, in sql
    File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 67, in connect
    use_unicode=True, charset=‘utf8mb4’)
    File “/home/frappe/frappe-bench/env/src/mysqlclient/MySQLdb/”, line 86, in Connect
    return Connection(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/src/mysqlclient/MySQLdb/”, line 204, in init
    super(Connection, self).init(*args, **kwargs2)
    _mysql_exceptions.OperationalError: (2002, ‘Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 “No such file or directory”)’)

Can’t even restart the database server.

sudo /etc/init.d/mysql start

The only way is
bench reinstall
do a
restore from backup?

Please advise.

Well you know there is an issue with your MySql

First check the error logs of your MySQL in

1 Like

Thank you for the fast response.

I checked again:
mysql.log - nothing 0 byte
mysql.err - nothin 0 byte
mysql.log.1.gz -nothing in it 20byte



Misc Settings




Disabling symbolic-links is recommended to prevent assorted security risks


Global, Non Engine-Specific Buffers



Generally, it is unwise to set the query cache to be

larger than 64-128M as this can decrease performance

since the penalty for flushing the cache can become



Per-Thread Buffers




#< Engine Specific Settings >


Set this to force MySQL to use a particular engine / table-type

for new tables. This setting can still be overridden by specifying

the engine explicitly in the CREATE TABLE statement.




Not sure what to set this to?

Try running a ‘du -sch /var/lib/mysql//.MYI’

This will give you a good estiamte on the size of all the MyISAM indexes.

(The buffer may not need to set that high, however)


This setting controls the size of the buffer that is allocated when

sorting MyISAM indexes during a REPAIR TABLE or when creating indexes





Note: While most settings in MySQL can be set at run-time, InnoDB

variables require restarting MySQL to apply.

If the customer already has InnoDB tables and wants to change the

size of the InnoDB tablespace and InnoDB logs, then:

1. Run a full backup with mysqldump

2. Stop MySQL

3. Move current ibdata and ib_logfiles out of /var/lib/mysql

4. Uncomment the below innodb_data_file_path and innodb_log_file_size

5. Start MySQL (it will recreate new InnoDB files)

6. Restore data from backup


InnoDB loves RAM. For customers using mostly InnoDB, consider setting

this variable somewhat liberally. Do make sure the server is 64-bit,

however, if you plan on setting it above 1.5-2GB.



innodb_file_per_table can be useful in certain cases

but be aware that it does not scale well with a

large number of tables!


Somewhat equivalent to table_cache for InnoDB

when using innodb_file_per_table.


If you are not sure what to set this two, the

following formula can offer up a rough idea:

(number of cpus * number of disks * 2)



#< Replication/Backup Settings >



It may be wise to include the server-name or an easy identifier

to the server in these logs, such as ‘log-bin=/var/lib/mysqllogs/db1-bin-log’



MySQL 5.0+ Only


This is usually only needed when setting up chained replication.


Enable this to make replication more resilient against server

crashes and restarts, but can cause higher I/O on the server.


MySQL 5.0+ Only

Uncomment the following when enabling multi-master replication

Do NOT uncomment these unless you know exactly what you are doing!



#< Script Settings >


(You probably do not need to change these)



Any new proposal?

There is no


frappe@erpnext:/var/lib/mysql$ dir
aria_log.00000001 mysql-bin.000089 mysql-bin.000099 mysql-bin.000109
aria_log_control mysql-bin.000090 mysql-bin.000100 mysql-bin.000110
d56cb677eaab3383 mysql-bin.000091 mysql-bin.000101 mysql-bin.000111
debian-10.0.flag mysql-bin.000092 mysql-bin.000102 mysql-bin.000112
ibdata1 mysql-bin.000093 mysql-bin.000103 mysql-error.log
ib_logfile0 mysql-bin.000094 mysql-bin.000104 mysql-slow.log
ib_logfile1 mysql-bin.000095 mysql-bin.000105 mysql_upgrade_info mysql-bin.000096 mysql-bin.000106 performance_schema
mysql mysql-bin.000097 mysql-bin.000107
mysql-bin.000088 mysql-bin.000098 mysql-bin.000108

eek TMI to grok krnkris

A search suggests this if you have no done so
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38) - Stack Overflow


Thanks to taking time for this.
I already done these, no success.

frappe@erpnext:/var/log$ mysqladmin -u root -p status
Enter password:
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)’
Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!

After the mariadb update my
is empty.

Do you have /var/run/mysqld/mysqld.sock
in your .ova VM instance?

“Do you have /var/run/mysqld/mysqld.sock
in your .ova VM instance?”

yes mine works

other ideas
reinstall your db or downgrade
compare cnf with another vm instance that works


Thank you, will try.

Product is working,
waiting for mariadb upgrade.

Will compare.

Takes some time.

Two ideas -

  1. NAT or bridged network config between guest VM and VB host is broken

  2. Your my.cnf does not list port or bind-address -

Mine here /etc/mysql/my.cnf lists those for eg

port = 3306
socket = /var/run/mysqld/mysqld.sock

Here is entries for some specific programs

The following values assume you have at least 32M ram

This was formally known as [safe_mysqld]. Both versions are currently parsed.

socket = /var/run/mysqld/mysqld.sock
nice = 0


* Basic Settings

user = mysql
pid-file = /var/run/mysqld/
socket = /var/run/mysqld/mysqld.sock
port = 3306

I found out
apt-get update Did not run fully

In this case I had to reinstall
Then restore.

Please clos this thread.

Thanks for the help.