You are not logged in.

#1 2022-07-07 09:22:03

sss20081
Member
Registered: 2022-03-26
Posts: 16

[SOLVED]Problems with pacman installing mysql

when i install mysql

Warning: Inconsistent permissions on directory /run/
:: You need to initialize the MySQL data directory prior to starting
   the service. This can be done with mysqld --initialize command, e.g.:
   mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
:: Additionally you should secure your MySQL installation using
   mysql_secure_installation command after starting the mysqld service

and when I reinstall mysql

Warning: Inconsistent permissions on directory /run/
Filesystem: 755 Packages: 775
Warning: Inconsistent permissions on directory /var/lib/mysqlrouter/
Filesystem: 700 Packages: 775
Warning: Inconsistent permissions on directory /var/log/mysqlrouter/
Filesystem: 750 Packages: 775

I would like to know why this problem occurs when installing mysql, and what is the solution to this

Last edited by sss20081 (2022-07-10 05:32:55)

Offline

#2 2022-07-07 09:32:47

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED]Problems with pacman installing mysql

man pacman
pacman -Qk $package

Offline

#3 2022-07-07 10:14:52

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

Awebb wrote:

man pacman
pacman -Qk $package

[1] 57272
[1]  + 57272 suspended (tty output)  sudo pacman -Qk
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)

Offline

#4 2022-07-07 10:24:40

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

I use

pacman -Qkk mysql

Thoroughly checked mysql
Then I got this

Warning: mysql: /run (permission mismatch)
Warning: mysql: /var/lib/mysqlrouter (user identifier UID mismatch)
Warning: mysql: /var/lib/mysqlrouter (user group identifier GID mismatch)
Warning: mysql: /var/lib/mysqlrouter (permission mismatch)
Warning: mysql: /var/log/mysqlrouter (user identifier UID mismatch)
Warning: mysql: /var/log/mysqlrouter (user group identifier GID mismatch)
Warning: mysql: /var/log/mysqlrouter (permission mismatch)
mysql: 326 all files, 3 changed files

I just want to know why this happens

Offline

#5 2022-07-07 12:44:27

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED]Problems with pacman installing mysql

There is no mysql package in the official repositories. You've either installed if from the AUR or from a third party repository. Alternatively, you're not running 64bit Archlinux. The correct replacement for mysql on Arch is mariadb.

Please clarify and post the output of uname -a.

Offline

#6 2022-07-07 13:56:20

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,358
Website

Re: [SOLVED]Problems with pacman installing mysql

Mod note: Moving to AUR issues.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2022-07-07 14:37:27

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

Awebb wrote:

There is no mysql package in the official repositories. You've either installed if from the AUR or from a third party repository. Alternatively, you're not running 64bit Archlinux. The correct replacement for mysql on Arch is mariadb.

Please clarify and post the output of uname -a.

Linux Arch 5.18.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 02 Jul 2022 21:03:06 +0000 x86_64 GNU/Linux

I installed mysql from AUR

Offline

#8 2022-07-07 14:41:24

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: [SOLVED]Problems with pacman installing mysql

The inconsistencies detected are expected as the package uses tmpfiles.d to change ownership and permissions https://aur.archlinux.org/cgit/aur.git/ … ch?h=mysql

:: You need to initialize the MySQL data directory prior to starting
   the service. This can be done with mysqld --initialize command, e.g.:
   mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Did you initialize the data directory before starting mysqld?

Offline

#9 2022-07-07 15:01:59

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

I initialized the data directory

Offline

#10 2022-07-07 15:06:01

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: [SOLVED]Problems with pacman installing mysql

sss20081 wrote:

I initialized the data directory

Was that before or after the output in the first post was produced?  If after can you now run mysqld successfully?
If you still can not run mysqld successfully what is the exact command you are using and the full output it produces?

Offline

#11 2022-07-07 19:56:59

Muflone
Package Maintainer (PM)
From: Italy
Registered: 2013-10-08
Posts: 142
Website

Re: [SOLVED]Problems with pacman installing mysql

loqs wrote:

The inconsistencies detected are expected as the package uses tmpfiles.d to change ownership and permissions https://aur.archlinux.org/cgit/aur.git/ … ch?h=mysql

:: You need to initialize the MySQL data directory prior to starting
   the service. This can be done with mysqld --initialize command, e.g.:
   mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Did you initialize the data directory before starting mysqld?

I think this worths a fix

Offline

#12 2022-07-07 23:54:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [SOLVED]Problems with pacman installing mysql

sss20081 reported wrote:

I've got mysql running now, I just want to know why the install shows up:
Warning, inconsistency in directory permissions
This has never happened to me before

If you were wondering why your post disappeared, you hit the report link, not the reply link


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#13 2022-07-08 00:46:46

loqs
Member
Registered: 2014-03-06
Posts: 18,818

Re: [SOLVED]Problems with pacman installing mysql

Muflone wrote:

I think this worths a fix

Stop packaging the directories and leave it to tmpfiles.d?

diff --git a/PKGBUILD b/PKGBUILD
index 04e514f..9f3228f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -226,6 +226,12 @@ package_mysql(){
   # Cleanup
   rmdir "${pkgdir}/usr/usr/lib"
   rmdir "${pkgdir}/usr/usr"
+  rmdir "${pkgdir}/run"
+  rmdir "${pkgdir}/var/lib/mysqlrouter"
+  rmdir "${pkgdir}/var/lib"
+  rmdir "${pkgdir}/var/log/mysqlrouter"
+  rmdir "${pkgdir}/var/log"
+  rmdir "${pkgdir}/var"
 
   # Arch Linux specific patches:
   #  * enable PrivateTmp for a little bit more security

Edit:
Remove /var as well.  Only empty directory remaining /usr/lib/mysql/plugin/debug

Last edited by loqs (2022-07-08 00:58:23)

Offline

#14 2022-07-08 23:58:44

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

sorry i can't understand

Offline

#15 2022-07-09 07:55:35

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,720

Re: [SOLVED]Problems with pacman installing mysql

loqs' comment was for Muflone, who maintains the mysql AUR.
But you could edit the PKGBUILD accordingly when building the mysql package.

Offline

#16 2022-07-09 17:52:02

Muflone
Package Maintainer (PM)
From: Italy
Registered: 2013-10-08
Posts: 142
Website

Re: [SOLVED]Problems with pacman installing mysql

sss20081 wrote:

and when I reinstall mysql

Warning: Inconsistent permissions on directory /run/
Filesystem: 755 Packages: 775
Warning: Inconsistent permissions on directory /var/lib/mysqlrouter/
Filesystem: 700 Packages: 775
Warning: Inconsistent permissions on directory /var/log/mysqlrouter/
Filesystem: 750 Packages: 775

I would like to know why this problem occurs when installing mysql, and what is the solution to this

Simply the mysql package contains such directories and it assumes the permissions 775
In your system instead you have the permissions 700 or 750

For this reason pacman warns you the directories permissions differ.

This is a bug in mysql package (which I maintain) as I used two different permissions sets (755 for the packaged directories and 700/750 for the directories created by systemd-tmpfiles). I'll fix the package soon.

You can safely ignore the warning message, though.

Offline

#17 2022-07-09 18:56:24

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED]Problems with pacman installing mysql

Besides you being a legend for maintaining mysql on the AUR, is this the moment where we ask "why not mariadb"?

Offline

#18 2022-07-10 05:29:05

sss20081
Member
Registered: 2022-03-26
Posts: 16

Re: [SOLVED]Problems with pacman installing mysql

ok, thanks for your help

Offline

Board footer

Powered by FluxBB