Question

Importation of large database has wrecked MySQL on Ubuntu 20.04

I tried importing a database weighing at 262 megabytes using mysql -u username -p databasename < sourcedatabasename.sql on my client’s server. The import command failed to complete.

I did not make any adjustments to the import size limit before importing the database. I am assuming this would cause issues.

Now when I try and access MySQL on my server using sudo mysql, I receive the following error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2).

I have also received this error while trying to log into MySQL using the terminal: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES).

I have tried following this help page with no success.

When I run sudo systemctl status mysql.service, the following is displayed.

mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2021-10-26 17:58:27 MDT; 46s ago Process: 1714 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Process: 1723 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Main PID: 1723 (code=exited, status=1/FAILURE) Status: “Server startup in progress”

Oct 26 17:56:46 username systemd[1]: Starting MySQL Community Server… Oct 26 17:58:27 username systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE Oct 26 17:58:27 username systemd[1]: mysql.service: Failed with result ‘exit-code’. Oct 26 17:58:27 username systemd[1]: Stopped MySQL Community Server.

If I run sudo reboot, I can make it to step 5, but running this command sudo kill `cat /var/run/mysqld/mysqld.pid results in this message: cat: /var/run/mysqld/mysqld.pid: No such file or directory.

Could someone please assist me with getting MySQL back up and running on my server.

Cheers,

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @mikehermary,

Could you confirm that after trying to import 262MB of data backup file only your MySQL service stopped?

And what you seeing when you run sudo systemctl start mysql.service?

FYR, I am sharing the below links to guide you with MySQL installation and Import/Export:

https://www.digitalocean.com/community/tutorials/how-to-install-the-latest-mysql-on-ubuntu-20-04

https://www.digitalocean.com/community/tutorials/how-to-import-and-export-databases-in-mysql-or-mariadb

Regards, Rajkishore