Sample Header Ad - 728x90

mySQL failed to be set-up

1 vote
1 answer
97 views
I'm running Gentoo Linux and recently needed to install mySQL (older version). The compilation was successful, however setting up the server failed. I'm on this step: https://wiki.gentoo.org/wiki/MySQL#Preliminary_configuration The complete log follows: WaylandGnome /home/igor/dbhandler/Debug # cat /var/tmp/portage/dev-db/mysql-5.7.41/temp/build.log * Detected settings: * ================== * MySQL User: mysql * MySQL Group: mysql * MySQL DATA directory: /var/lib/mysql * MySQL TMP directory: /tmp * PID DIR: /run/mysqld * Install db log: /tmp/install_db.221119222.log * Install server log: /tmp/install_mysqld.633921321.log * Trying to get password for mysql 'root' user from 'mysql' section ... * Trying to get password for mysql 'root' user from 'client' section ... * No password for mysql 'root' user was specified via environment * variable MYSQL_ROOT_PASSWORD and no password was found in config * file like '/root/.my.cnf'. * To continue please provide a password for the mysql 'root' user * now on console: * NOTE: Please avoid ["'\_%] characters in the password! > * Retype the password > * Initializing mysql data directory: /usr/sbin/mysqld --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-federated --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --initialize-insecure --init-file='/tmp/tz.222211327.sql' --basedir='/usr' --datadir='/var/lib/mysql' --tmpdir='/tmp' --log-error='/tmp/install_db.221119222.log' --user=mysql /var/tmp/portage/dev-db/mysql-5.7.41/temp/environment: line 3774: /tmp/install_db.221119222.log: Permission denied * ERROR: dev-db/mysql-5.7.41::gentoo failed (config phase): * Failed to initialize mysql data directory. Please review '/tmp/install_db.221119222.log'! * * Call stack: * ebuild.sh, line 136: Called pkg_config * environment, line 3777: Called die * The specific snippet of code: * die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!"; * * If you need support, post the output of emerge --info '=dev-db/mysql-5.7.41::gentoo', * the complete build log and the output of emerge -pqv '=dev-db/mysql-5.7.41::gentoo'. * The complete build log is located at '/var/tmp/portage/dev-db/mysql-5.7.41/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.7.41/temp/environment'. * Working directory: '/var/tmp/portage/dev-db/mysql-5.7.41/empty' * S: '/var/tmp/portage/dev-db/mysql-5.7.41/work/mysql-5.7.41' WaylandGnome /home/igor/dbhandler/Debug # How do I identify the issue? I'm trying this at home - for the development/testing purposes. The info is in the original post above. EDIT: WaylandGnome /home/igor/dbhandler/Debug # ls -la / total 202248 drwxr-xr-x 21 root root 4096 Aug 21 2021 . drwxr-xr-x 21 root root 4096 Aug 21 2021 .. drwxr-xr-x 2 root root 4096 Apr 3 2024 bin drwxr-xr-x 3 root root 4096 Jun 16 2024 boot drwxr-xr-x 16 root root 3580 Jul 16 21:07 dev drwxr-xr-x 79 root root 4096 Jul 22 19:54 etc drwxr-xr-x 3 root root 4096 Aug 16 2021 home drwxr-xr-x 12 root root 4096 Jun 24 2024 lib drwxr-xr-x 6 root root 4096 Dec 8 2024 lib64 drwx------ 2 root root 16384 Aug 9 2021 lost+found drwxr-xr-x 2 root root 4096 Aug 8 2021 media drwxr-xr-x 4 root root 4096 Aug 29 2021 mnt -rw-r--r-- 1 root root 9865 Aug 21 2021 modules_loaded drwxr-xr-x 2 root root 4096 Aug 8 2021 opt dr-xr-xr-x 278 root root 0 Jul 16 16:07 proc drwx------ 6 root root 4096 Jul 21 20:08 root drwxr-xr-x 20 root root 680 Jul 16 21:08 run drwxr-xr-x 2 root root 4096 Jun 24 2024 sbin -rw-r--r-- 1 root root 207004312 Aug 9 2021 stage3-amd64-openrc-20210808T170546Z.tar.xz dr-xr-xr-x 13 root root 0 Jul 16 21:25 sys drwxrwxrwt 10 root root 4096 Jul 23 22:47 tmp drwxr-xr-x 12 root root 4096 Aug 8 2021 usr drwxr-xr-x 10 root root 4096 Dec 8 2024 var WaylandGnome /home/igor/dbhandler/Debug # As you can see, the /tmp directory have the right rights and its owned by root (the user who tries to write the log). EDIT2: WaylandGnome /home/igor/dbhandler/Debug # ls -la /tmp/ total 1696 drwxrwxrwt 10 root root 4096 Jul 27 10:57 . drwxr-xr-x 21 root root 4096 Aug 21 2021 .. srw-rw-rw- 1 root root 0 Jul 16 21:07 dbus-LrgQbbHE srw-rw-rw- 1 root root 0 Jul 16 21:07 dbus-PLcQRTxs srwxrwxrwx 1 igor igor 0 Jul 16 21:08 dbus-SUXCQJk4lu drwx------ 2 igor igor 4096 Jul 27 10:57 dhcpcd-igor drwxrwxrwt 2 root root 4096 Jul 16 21:07 .font-unix drwxrwxrwt 2 root root 4096 Jul 16 21:08 .ICE-unix -rw-r--r-- 1 mysql root 0 Jul 16 21:10 install_db.221119222.log -rw-r--r-- 1 mysql root 0 Jul 16 21:10 install_mysqld.633921321.log drwxrwxr-x 2 portage portage 4096 Jul 16 21:07 portage drwx------ 2 igor igor 4096 Jul 16 21:08 ssh-XXXXXXjJPiXO drwx------ 2 igor igor 4096 Jul 16 21:09 Temp-204e4dce-7ae7-4061-98a7-02c745548045 -rw-r--r-- 1 igor igor 11409 Jul 17 19:57 tmpaddon -rw-r--r-- 1 igor igor 11409 Jul 20 14:41 tmpaddon-1 -rw-r--r-- 1 igor igor 11409 Jul 21 14:41 tmpaddon-2 -rw-r--r-- 1 igor igor 11409 Jul 22 20:23 tmpaddon-3 -rw-r--r-- 1 igor igor 11409 Jul 25 22:33 tmpaddon-4 -rw-r--r-- 1 igor igor 11409 Jul 26 22:33 tmpaddon-5 -rw-r--r-- 1 root root 1620537 Jul 16 21:10 tz.222211327.sql srwxr-xr-x 1 root root 0 Jul 16 21:07 wpa_ctrl_1714-1 drwxrwxrwt 2 root root 4096 Jul 16 21:08 .X11-unix drwxrwxrwt 2 root root 4096 Jul 16 21:07 .XIM-unix WaylandGnome /home/igor/dbhandler/Debug # As you can see the configure log file is there - but its size is 0. Something is definite wrong here... EDIT3: This is my mount results: WaylandGnome /home/igor/dbhandler/Debug # mount | grep tmp devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=950062,mode=755) tmpfs on /run type tmpfs (rw,nosuid,nodev,size=1520712k,nr_inodes=819200,mode=755) shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=760352k,nr_inodes=190088,mode=700,uid=1000,gid=1000) WaylandGnome /home/igor/dbhandler/Debug # And this is the full mount result: WaylandGnome /home/igor/dbhandler/Debug # mount /dev/sda3 on / type ext4 (rw,noatime) devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=950062,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,size=1520712k,nr_inodes=819200,mode=755) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate) mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=760352k,nr_inodes=190088,mode=700,uid=1000,gid=1000) tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime) EDIT3: I tried to run that command manually using my own home directory, but... /usr/sbin/mysqld --loose-skip-host-cache --loose-skip-name-resolve --loose-skip-networking --loose-skip-slave-start --loose-skip-federated --loose-skip-ssl --loose-skip-log-bin --loose-skip-relay-log --loose-skip-slow-query-log --loose-skip-external-locking --loose-skip-log-slave-updates --initialize-insecure --init-file='/home/igor/tz.222211327.sql' --basedir='/usr' --datadir='/var/lib/mysql' --tmpdir='/tmp' --log-error='/home/igor/install_db.221119222.log' --user=mysql 2025-08-01T19:22:05.565679Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-08-01T19:22:05.573910Z 0 [ERROR] Could not open file '/home/igor/install_db.221119222.log' for error logging: Permission denied 2025-08-01T19:22:05.574057Z 0 [ERROR] Aborting I presume this is some kind of compatibility issue as I also did this: WaylandGnome /home/igor/dbhandler/Debug # touch /home/igor/install_db.221119222.log WaylandGnome /home/igor/dbhandler/Debug # WaylandGnome /home/igor/dbhandler/Debug # and as you can see it finish successfully. I guess I will need to abandon the idea of using the mySQL 5 - at least for nnw... Thank you.
Asked by Igor (253 rep)
Jul 23, 2025, 01:07 AM
Last activity: Aug 1, 2025, 07:29 PM