I have recently loaded bullseye onto my new Raspberry Pi 4. Previously I have been using Raspberry Pi 2 and 3 with few issues. Now i noticed that mysql is not available on my 4 so I ran the command 'apt-get install mariadb-server'. However, when I then tried to load mysql I got the msg: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
Also noticed that there is no service for mysql or mariadb. Any advice would be greatly appreciated. Thx in advance.
Re: unable to run mysql (mariadb)
It should just work. I have installed mariadb-server many times without problems.
What does "sudo systemctl status mariadb" show?
What does "sudo systemctl status mariadb" show?
Unreadable squiggle
Re: unable to run mysql (mariadb)
I know. I also have loaded mysql/mariadb on all my earlier Raspbery Pis. To answer your question, there is no reply to systemctl (which I verified) since ther is no m*.service. Still stumped, and right now dead in the water.
Re: unable to run mysql (mariadb)
Can you show
Code: Select all
sudo apt search mariadb|grep installed
Re: unable to run mysql (mariadb)
root@Ra4pi:/odin > apt search mariadb|grep installed > maria 2> maria.err
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
root@Ra4pi:/odin > cat maria
libdbd-mysql-perl/stable,now 4.050-3+b1 arm64 [installed]
libmariadb-dev/stable,now 1:10.5.18-0+deb11u1 arm64 [installed]
libmariadb3/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
mariadb-client-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-client-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-common/stable,stable,now 1:10.5.18-0+deb11u1 all [installed,automatic]
mariadb-server/stable,stable,now 1:10.5.18-0+deb11u1 all [installed]
mariadb-server-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
root@Ra4pi:/odin > cat maria
libdbd-mysql-perl/stable,now 4.050-3+b1 arm64 [installed]
libmariadb-dev/stable,now 1:10.5.18-0+deb11u1 arm64 [installed]
libmariadb3/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
mariadb-client-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-client-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-common/stable,stable,now 1:10.5.18-0+deb11u1 all [installed,automatic]
mariadb-server/stable,stable,now 1:10.5.18-0+deb11u1 all [installed]
mariadb-server-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
Re: unable to run mysql (mariadb)
root@Ra4pi:/odin > apt search mariadb|grep installed > maria 2> maria.err
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
root@Ra4pi:/odin > cat maria
libdbd-mysql-perl/stable,now 4.050-3+b1 arm64 [installed]
libmariadb-dev/stable,now 1:10.5.18-0+deb11u1 arm64 [installed]
libmariadb3/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
mariadb-client-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-client-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-common/stable,stable,now 1:10.5.18-0+deb11u1 all [installed,automatic]
mariadb-server/stable,stable,now 1:10.5.18-0+deb11u1 all [installed]
mariadb-server-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
root@Ra4pi:/odin > cat maria
libdbd-mysql-perl/stable,now 4.050-3+b1 arm64 [installed]
libmariadb-dev/stable,now 1:10.5.18-0+deb11u1 arm64 [installed]
libmariadb3/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
mariadb-client-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-client-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,auto-removable]
mariadb-common/stable,stable,now 1:10.5.18-0+deb11u1 all [installed,automatic]
mariadb-server/stable,stable,now 1:10.5.18-0+deb11u1 all [installed]
mariadb-server-core-10.5/stable,now 1:10.5.18-0+deb11u1 arm64 [installed,automatic]
Re: unable to run mysql (mariadb)
For reference, the is the outcome of the same command in my Raspberry Pi 3 (buster):
root@Wa3pi:/run/mysqld > apt search mariadb:grep installed
Sorting... Done
Full Text Search... Done
root@Wa3pi:/run/mysqld > apt search mariadb:grep installed
Sorting... Done
Full Text Search... Done
Re: unable to run mysql (mariadb)
This may be a clue. There is no mysql user. When I tried to create one I got the msg:
root@Ra4pi:/run > adduser mysql
Undefined subroutine &I18N::Langinfo::YESEXPR called at /usr/sbin/adduser line 80.
root@Ra4pi:/run > adduser mysql
Undefined subroutine &I18N::Langinfo::YESEXPR called at /usr/sbin/adduser line 80.
Re: unable to run mysql (mariadb)
Noa a clue since same error msg appears in my Raspberry Pi 3 which handles mysql. Both systems show adduser version is 3.118 and both systems should not hickup when issuing the adduser command. This may be a serious problem. Not sure yet
Re: unable to run mysql (mariadb)
mariadb-server currently installs mariadb-server-10.5 which is missing as a package from your install, I guess this was installed some time ago and been upgraded a few times, or its been installed from outside the repository..
Have you checked /etc/passwd to see if mysql exists as a user there?
Have you checked /etc/passwd to see if mysql exists as a user there?
Re: unable to run mysql (mariadb)
It doesn't, and that's what prompted me to try to add it and subsequently realized I can't.
Re: unable to run mysql (mariadb)
I would start off with a fresh RPiOS, it looks like you have multiple broken items.
Re: unable to run mysql (mariadb)
I installed mariadb with the command apt-get install mariadb-server.
I even tried it again.
Since it didn't install correctly I have no idea what version it is, although I do know that perl is version 5.32.1
On the Raspberry Pi 3 (Buster) where mysql works, it is version 10.3.36 and perl is version 5.28.1
Would it be possible to install that version of mariadb instead of the latest in hopes of fixing my issue?
I even tried it again.
Since it didn't install correctly I have no idea what version it is, although I do know that perl is version 5.32.1
On the Raspberry Pi 3 (Buster) where mysql works, it is version 10.3.36 and perl is version 5.28.1
Would it be possible to install that version of mariadb instead of the latest in hopes of fixing my issue?
Re: unable to run mysql (mariadb)
As mentioned above, try installing the mariadb-server-10.5
Code: Select all
sudo apt install mariadb-server-10.5
Unreadable squiggle
Re: unable to run mysql (mariadb)
Sorry - I missed the version. However, I tried your suggestion but got errors:
debconf: Perl may be unconfigured (Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
(Reading database ... 99277 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb ...
Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7.
Compilation failed in require at /usr/share/debconf/frontend line 6.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 6.
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb (--unpack):
new mariadb-server-10.5 package pre-installation script subprocess returned error exit status 255
Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7.
Compilation failed in require at /usr/share/debconf/frontend line 6.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 6.
dpkg: error while cleaning up:
new mariadb-server-10.5 package post-removal script subprocess returned error exit status 255
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
debconf: Perl may be unconfigured (Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
(Reading database ... 99277 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb ...
Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7.
Compilation failed in require at /usr/share/debconf/frontend line 6.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 6.
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb (--unpack):
new mariadb-server-10.5 package pre-installation script subprocess returned error exit status 255
Undefined subroutine &Hash::Util::_clear_placeholders called at /usr/lib/aarch64-linux-gnu/perl-base/Hash/Util.pm line 63.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7.
BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm line 7.
Compilation failed in require at /usr/share/debconf/frontend line 6.
BEGIN failed--compilation aborted at /usr/share/debconf/frontend line 6.
dpkg: error while cleaning up:
new mariadb-server-10.5 package post-removal script subprocess returned error exit status 255
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.5_1%3a10.5.18-0+deb11u1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Re: unable to run mysql (mariadb)
It sounds like you have some corruption in that system. The fact that the mariadb-server-10.5 wasn't automatically installed in the first place, and now those errors all point towards OS corruption of some sort.
Unreadable squiggle