C
C
Chizhelloo2021-05-29 02:23:13
MySQL
Chizhelloo, 2021-05-29 02:23:13

How to install MySQL 8 on a symbolic link?

There is a mounted disk, on it I created a symbolic link for the /data/mysql folder as /var/lib/mysql
When I try to install the mysql-server package, I get an error

mysqld is running as pid 1227
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Fri 2021-05-28 22:45:51 UTC; 7ms ago
    Process: 1438 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 1451 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 1451 (code=exited, status=1/FAILURE)
     Status: "Server startup in progress"
      Error: 13 (Permission denied)

May 28 22:45:51 ip-sobaka systemd[1]: mysql.service: Failed with result 'exit-code'.
May 28 22:45:51 ip-sobaka systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Setting up libcgi-pm-perl (4.46-1) ...
Setting up libhtml-template-perl (2.97-1) ...
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up libcgi-fast-perl (1:2.15-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (245.4-4ubuntu3.6) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


If the link is removed, then everything will be without problems. Only now it is needed) How can I still install a package on a link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Fedoseev, 2021-05-29
@Chizelloo

the package is not linked.
1. remove the link.
2. Install the server
3. Stop the server.
4. Make a symlink to /var/lib/mysql. Be sure to correctly set the owner and access rights
5. All

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question