Error installing MySQL
Ubuntu 22.04
After Installing MySQL in Terminal and run got this error:
luis@l-
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/
luis@l-
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
luis@l-
Please help to correct this
Thank you
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Luis M.Jacinto
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
What about following the instructions given:
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
Revision history for this message
|
#2 |
Following the instructions the result follows keeps repeat the same send only part.
I don’t understand what it means need help to correct what is wrong.
luis@l-
× mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Wed 2023-02-22 09:29:04 SAST; 2h 37min ago
Process: 23819 ExecStartPre=
Process: 23827 ExecStart=
Main PID: 23827 (code=exited, status=1/FAILURE)
Status: "Server shutdown complete"
Error: 2 (No such file or directory)
CPU: 290ms
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Feb 22 09:29:04 l-System-luisj systemd[1]: Stopped MySQL Community Server.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Start request repeated too quickly.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 22 09:29:04 l-System-luisj systemd[1]: Failed to start MySQL Community Server.
luis@l-
Feb 22 09:29:04 l-System-luisj systemd[1]: Stopped MySQL Community Server.
░░ Subject: A stop job for unit mysql.service has finished
░░ Defined-By: systemd
░░ Support: http://
░░
░░ A stop job for unit mysql.service has finished.
░░
░░ The job identifier is 5868 and the job result is done.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Start request repeated too quickly.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://
░░
░░ The unit mysql.service has entered the 'failed' state with result 'exit-code'.
Feb 22 09:29:04 l-System-luisj systemd[1]: Failed to start MySQL Community Server.
░░ Subject: A start job for unit mysql.service has failed
░░ Defined-By: systemd
░░ Support: http://
░░
░░ A start job for unit mysql.service has finished with a failure.
░░
░░ The job identifier is 5868 and the job result is failed.
lines 807-829/829 (END)
Feb 22 09:29:04 l-System-luisj systemd[1]: Stopped MySQL Community Server.
░░ Subject: A stop job for unit mysql.service has finished
░░ Defined-By: systemd
░░ Support: http://
░░
░░ A stop job for unit mysql.service has finished.
░░
░░ The job identifier is 5868 and the job result is done.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Start request repeated too quickly.
Feb 22 09:29:04 l-System-luisj systemd[1]: mysql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://
░░
░░ The unit mysql.service has entered the 'failed' state with result 'exit-code'.
Feb 22 09:29:04 l-System-luisj systemd[1]: Failed to start MySQL Community Server.
░░ Subject: A start job for unit mysql.service has failed
░░ Defined-By: systemd
░░ Support: http://
░░
░░ A start job for unit mysql.service has finished with a failure.
░░
░░ The job identifier is 5868 and the job result is failed.
Revision history for this message
|
#3 |
Are you sure that the configuration of the mySQL server is correct?
Revision history for this message
|
#4 |
I never configure mySQL it was just after installing and run sudo mysql that the error come.
Revision history for this message
|
#5 |
Revision history for this message
|
#6 |
I follow the suggestion but nothing come correct still got problems
Mysql is not installed but something stops the installation.
Is there something can help this be fixed
luis@l-
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-server-8.0 : Depends: mysql-server-
E: Unable to correct problems, you have held broken packages.
luis@l-
Unit mysql.service could not be found.
luis@l-
Revision history for this message
|
#7 |
For diagnostic purposes, what is the output of the commands
uname -a
lsb_release -crid
sudo dpkg --audit
apt policy mysql-server-8.0 mysql-server-
apt --simulate install libhtml-
Revision history for this message
|
#8 |
luis@l-
Linux l-System-luisj 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
luis@l-
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
luis@l-
[sudo] password for luis:
luis@l-
mysql-server-8.0:
Installed: (none)
Candidate: 8.0.28-0ubuntu4
Version table:
8.
500 http://
mysql-server-
Installed: 8.0.32-
Candidate: 8.0.32-
Version table:
*** 8.0.32-
100 /var/lib/
8.
500 http://
libhtml-
Installed: (none)
Candidate: 2.97-1.1
Version table:
2.97-1.1 500
500 http://
500 http://
mecab-ipadic-utf8:
Installed: (none)
Candidate: 2.7.0-20070801+
Version table:
2.
500 http://
500 http://
luis@l-
NOTE: This is only a simulation!
apt needs root privileges for real execution.
Keep also in mind that locking is deactivated,
so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl mecab-ipadic mecab-utils
Suggested packages:
libipc-
The following NEW packages will be installed:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Inst libcgi-pm-perl (4.54-1 Ubuntu:22.04/jammy [all])
Inst libfcgi0ldbl (2.4.2-2build2 Ubuntu:22.04/jammy [amd64])
Inst libfcgi-perl (0.82+ds-1build1 Ubuntu:22.04/jammy [amd64])
Inst libcgi-fast-perl (1:2.15-1 Ubuntu:22.04/jammy [all])
Inst libfcgi-bin (2.4.2-2build2 Ubuntu:22.04/jammy [amd64])
Inst libhtml-
Inst mecab-utils (0.996-14build9 Ubuntu:22.04/jammy [amd64])
Inst mecab-ipadic (2.7.0-
Inst mecab-ipadic-utf8 (2.7.0-
Conf libcgi-pm-perl (4.54-1 Ubuntu:22.04/jammy [all])
Conf libfcgi0ldbl (2.4.2-2build2 Ubuntu:22.04/jammy [amd64])
Conf libfcgi-perl (0.82+ds-1build1 Ubuntu:22.04/jammy [amd64])
Conf libcgi-fast-perl (1:2.15-1 Ubuntu:22.04/jammy [all])
Conf libfcgi-bin (2.4.2-2build2 Ubuntu:22.04/jammy [amd64])
Conf libhtml-
Conf mecab-utils (0.996-14build9 Ubuntu:22.04/jammy [amd64])
Conf mecab-ipadic (2.7.0-
Conf mecab-ipadic-utf8 (2.7.0-
luis@l-
Revision history for this message
|
#9 |
mysql-server-
Installed: 8.0.32-
Candidate: 8.0.32-
Version table:
*** 8.0.32-
100 /var/lib/
8.
500 http://
It seems that you are missing "jammy-updates" and "jammy-security" in your list of repositories (eventually also "jammy-backports").
Revision history for this message
|
#10 |
There no "jammy-security” or "jammy-backports" in Repositories.
Need help how to insert these two.
Revision history for this message
|
#11 |
Open Update-manager and click on settings (or run the command software-
What do you see there?
Revision history for this message
|
#12 |
I took a screenshot don’t know how to add here.
Revision history for this message
|
#13 |
There is no need for posting a screen shot, just tell whether you see "jammy-security” and "jammy-backports" on that screen
In comment #10 you wrote 'There no "jammy-security” or "jammy-backports" in Repositories.'
You should enable these repositories (and eventually also "jammy-backports").
Revision history for this message
|
#14 |
Now I am confused.
In Update-manager "updates" tab read from the top:
Snap package updates are checked routinely and installed automatically
Foe other packages, list system has: Basic Security Maintenance
Active until 21/04/2027
There is nothing refer to “jammy-security” or "jammy-backports"
In Other Software the entry's it ends /”jammy main” and /”jammy main (Sourece Code)”.
Again there no reference to “jammy-security” or "jammy-backports"
Revision history for this message
|
#15 |
You are right. I was not aware that this function has been removed in the newest version of software-
I suggest adding the jammy-updates and jammy-security repositories manually.
What is the output of the command
cat -n /etc/apt/
Revision history for this message
|
#16 |
luis@l-
1 deb http://
luis@l-
Revision history for this message
|
#17 |
What happened to your sources.list file? It should be about 50 lines! Did you modify it on purpose? Why?
Revision history for this message
|
#18 |
In which part of the world are you located?
Your user settings in launchpad tell about South Africa, but the server in your current sources.list file is in Belgium.
A typical sources.list file (for South Africa) looks like this:
# deb cdrom:[Ubuntu 20.04.4 LTS _Focal Fossa_ - Release amd64 (20220223)]/ focal main restricted
# See http://
# newer versions of the distribution.
deb http://
# deb-src http://
## Major bug fix updates produced after the final release of the
## distribution.
deb http://
# deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://
# deb-src http://
deb http://
# deb-src http://
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://
# deb-src http://
deb http://
# deb-src http://
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://
# deb-src http://
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://
# deb-src http://
deb http://
# deb-src http://
deb http://
# deb-src http://
deb http://
# deb-src http://
Revision history for this message
|
#19 |
I am located in South Africa (Durban).
In repositories there is place to find best place sources.list for my setup and it gave me
the Belgium I was surprise but accepted.
Now I have another problem I thick broke repositories.
While adding “jammy-updates” something went wrong Software Update don’t open starting
Synaptic it gives this error:
E: Malformed entry 1 in list file/etc/
http_archive_
E: The list of sources could not be read.
E:_cache→
Apologize for this mistake, and thank you for the help.
Revision history for this message
|
#20 |
What have you done to add jammy-updates?
What is now the output of
cat -n /etc/apt/
cat -n /etc/apt/
Revision history for this message
|
#21 |
luis@l-
1 deb http://
luis@l-
I want to change the server to local to fix averything.
Revision history for this message
|
#22 |
CORRECTION
luis@l-
1 deb http://
luis@l-
cat: /etc/apt/
luis@l-
Revision history for this message
|
#23 |
Already asked in comment #20
What have you done (or tried) to add jammy-updates?
In comment #18 I have already given the example contents which I think will be adequate for your system.
I suggest that you edit the /etc/apt/
Are there any files inside the directory /etc/apt/
Revision history for this message
|
#24 |
On adding jammy-updates I use “deb http://
Software Update and opening Synaptic gives the error mention before.
About editing /etc/apt/
Files on the directory etc/apt/
Revision history for this message
|
#25 |
I assume when trying to add
“deb http://
you used wrong quote characters. ( ” instead of " )
Please provide the full output that you receive for the following command:
grep -v nonexistingstring /etc/apt/
Revision history for this message
|
#26 |
Been away for few days come back on the job.
Don't remember what quotes characters I use on adding jammy-updates.
luis@l-
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
/etc/apt/
luis@l-
Revision history for this message
|
#27 |
Already written in comment #23:
In comment #18 I have already given the example contents which I think will be adequate for your system.
I suggest that you edit the /etc/apt/
Repeating and giving step-by-step instructions:
Open a terminal window
Issue the command
sudo gedit /etc/apt/
In the editor window that opens after entering your password (when requested, to confirm an administrative action) delete the line of text that is there and paste everything from comment #18 into the edit window (minus the first six lines).
Save the file and close the editor.
In the terminal window issue the following commands:
sudo rm /etc/apt/
sudo rm /etc/apt/
sudo rm /etc/apt/
sudo rm /etc/apt/
sudo rm /etc/apt/
sudo rm /etc/apt/
Finally execute the commands
sudo apt update
ls -l /etc/apt/
and copy/paste the output that we can see the results.
Revision history for this message
|
#28 |
souces.list page opens delete the line of text then notice the errors in Terminal had to Close Terminal
luis@l-
[sudo] password for luis:
(gedit:9830): dconf-WARNING **: 07:21:14.346: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
(gedit:9830): dconf-WARNING **: 07:21:14.351: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
(gedit:9830): dconf-WARNING **: 07:21:14.742: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
(gedit:9830): dconf-WARNING **: 07:21:14.742: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
(gedit:9830): dconf-WARNING **: 07:21:14.742: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
Revision history for this message
|
#29 |
"... had to Close Terminal"
Why did you close the terminal window?
Those messages are warnings that can be ignored.
Just modify the contents of /etc/apt/
Revision history for this message
|
#30 |
luis@l-
total 40
-rw-r--r-- 1 root root 110 Mar 3 07:36 archive_
-rw-r--r-- 1 root root 150 Mar 3 07:36 bablu-boy-
-rw-r--r-- 1 root root 150 Mar 3 07:36 bablu-boy-
-rw-r--r-- 1 root root 174 Mar 3 07:36 jentiger-
-rw-r--r-- 1 root root 174 Mar 3 07:36 jentiger-
-rw-r--r-- 1 root root 158 Mar 3 07:36 michael-
-rw-r--r-- 1 root root 172 Mar 3 07:36 michael-
-rw-r--r-- 1 root root 170 Mar 3 07:36 michael-
-rw-r--r-- 1 root root 176 Mar 3 07:36 thierry-
-rw-r--r-- 1 root root 154 Mar 3 07:36 webupd8team-
luis@l-
Revision history for this message
|
#31 |
Do some cleanup:
sudo rm /etc/apt/
And then back to the other problem, what is now the output of the commands
sudo apt update
sudo apt install mysql-server
Revision history for this message
|
#32 |
luis@l-
[sudo] password for luis:
luis@l-
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 https:/
Hit:6 http://
Hit:7 https:/
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
99 packages can be upgraded. Run 'apt list --upgradable' to see them.
luis@l-
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-
mecab-utils mysql-client-8.0 mysql-common mysql-server-8.0
Suggested packages:
libipc-
The following NEW packages will be installed:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-
mecab-utils mysql-client-8.0 mysql-common mysql-server mysql-server-8.0
0 upgraded, 13 newly installed, 0 to remove and 99 not upgraded.
Need to get 8,481 kB/8,513 kB of archives.
After this operation, 57.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Fetched 8,481 kB in 7s (1,225 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 257501 files and directories currently installed.)
Preparing to unpack .../mysql-
Unpacking mysql-common (5.8+1.0.8) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-
Unpacking mysql-client-8.0 (8.0.32-
Setting up mysql-common (5.8+1.0.8) ...
update-
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 257528 files and directories currently installed.)
Preparing to unpack .../00-
Unpacking mysql-server-8.0 (8.0.32-
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../01-
Unpacking libcgi-pm-perl (4.54-1) ...
Selecting previously unselected package libfcgi0ldbl:amd64.
Preparing to unpack .../02-
Unpacking libfcgi0ldbl:amd64 (2.4.2-2build2) ...
Selecting previously unselected package libfcgi-perl:amd64.
Preparing to unpack .../03-
Unpacking libfcgi-perl:amd64 (0.82+ds-1build1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../04-
Unpacking libcgi-fast-perl (1:2.15-1) ...
Selecting previously unselected package libfcgi-bin.
Preparing to unpack .../05-
Unpacking libfcgi-bin (2.4.2-2build2) ...
Selecting previously unselected package libhtml-
Preparing to unpack .../06-
Unpacking libhtml-
Selecting previously unselected package mecab-utils.
Preparing to unpack .../07-
Unpacking mecab-utils (0.996-14build9) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../08-
Unpacking mecab-ipadic (2.7.0-
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../09-
Unpacking mecab-ipadic-utf8 (2.7.0-
Selecting previously unselected package mysql-server.
Preparing to unpack .../10-
Unpacking mysql-server (8.0.32-
Setting up libfcgi0ldbl:amd64 (2.4.2-2build2) ...
Setting up libcgi-pm-perl (4.54-1) ...
Setting up libfcgi-bin (2.4.2-2build2) ...
Setting up libhtml-
Setting up mecab-utils (0.996-14build9) ...
Setting up mysql-client-8.0 (8.0.32-
Setting up libfcgi-perl:amd64 (0.82+ds-1build1) ...
Setting up mysql-server-8.0 (8.0.32-
update-
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/
mysqld is running as pid 12093
Created symlink /etc/systemd/
Setting up mecab-ipadic (2.7.0-
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/
emitting double-array: 100% |######
/usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
emitting double-array: 100% |######
reading /usr/share/
emitting matrix : 100% |######
done!
update-
Setting up libcgi-fast-perl (1:2.15-1) ...
Setting up mecab-ipadic-utf8 (2.7.0-
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/
emitting double-array: 100% |######
/usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
reading /usr/share/
emitting double-array: 100% |######
reading /usr/share/
emitting matrix : 100% |######
done!
update-
Setting up mysql-server (8.0.32-
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
luis@l-
Revision history for this message
|
#33 |
This looks good. I do not see any error any more and MySQL seems to be installed and running.
Revision history for this message
|
#34 |
Thank you for the great help from you as always and a great service from this forum.