13

I was trying re-installing mysql-server, but I am getting some sort of warning during installation. It got installed but it's not working.

Setting up mysql-client-core-5.7 (5.7.23-0ubuntu0.18.04.1) ...
Setting up mysql-server-core-5.7 (5.7.23-0ubuntu0.18.04.1) ...
Setting up mysql-client-5.7 (5.7.23-0ubuntu0.18.04.1) ...
Setting up mysql-server-5.7 (5.7.23-0ubuntu0.18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide 
/etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot stat file /proc/1927/fd/4: Permission denied
Cannot stat file /proc/1927/fd/5: Permission denied
Cannot stat file /proc/1927/fd/6: Permission denied
Cannot stat file /proc/1927/fd/25: Permission denied
Cannot stat file /proc/1927/fd/35: Permission denied
Cannot stat file /proc/1927/fd/36: Permission denied
Cannot stat file /proc/1927/fd/37: Permission denied
Cannot stat file /proc/1927/fd/38: Permission denied
Cannot stat file /proc/1927/fd/39: Permission denied
Cannot stat file /proc/1927/fd/40: Permission denied
Cannot stat file /proc/1927/fd/41: Permission denied
Cannot stat file /proc/1927/fd/101: Permission denied
Cannot stat file /proc/1927/fd/102: Permission denied
Cannot stat file /proc/1927/fd/1023: Permission denied
Cannot stat file /proc/2091/fd/5: Permission denied
Cannot stat file /proc/2091/fd/6: Permission denied
Cannot stat file /proc/2091/fd/7: Permission denied
Cannot stat file /proc/2091/fd/8: Permission denied
Cannot stat file /proc/2091/fd/9: Permission denied
Cannot stat file /proc/2091/fd/10: Permission denied
Cannot stat file /proc/2091/fd/11: Permission denied
Cannot stat file /proc/2091/fd/12: Permission denied
Cannot stat file /proc/2091/fd/13: Permission denied
Cannot stat file /proc/2091/fd/14: Permission denied
Cannot stat file /proc/2176/fd/3: Permission denied
Cannot stat file /proc/2316/fd/5: Permission denied
Cannot stat file /proc/2316/fd/6: Permission denied
Cannot stat file /proc/2316/fd/7: Permission denied
Cannot stat file /proc/2316/fd/8: Permission denied
Cannot stat file /proc/2316/fd/9: Permission denied
Cannot stat file /proc/2316/fd/10: Permission denied
Cannot stat file /proc/2316/fd/11: Permission denied
Cannot stat file /proc/2316/fd/12: Permission denied
Cannot stat file /proc/2316/fd/13: Permission denied
Cannot stat file /proc/2316/fd/14: Permission denied
Cannot stat file /proc/2316/fd/18: Permission denied
Cannot stat file /proc/2316/fd/19: Permission denied
Cannot stat file /proc/2316/fd/38: Permission denied
Cannot stat file /proc/2334/fd/4: Permission denied
Cannot stat file /proc/2334/fd/5: Permission denied
Cannot stat file /proc/2334/fd/6: Permission denied
Cannot stat file /proc/2334/fd/25: Permission denied
Cannot stat file /proc/2334/fd/35: Permission denied
Cannot stat file /proc/2334/fd/36: Permission denied
Cannot stat file /proc/2334/fd/37: Permission denied
Cannot stat file /proc/2334/fd/38: Permission denied
Cannot stat file /proc/2334/fd/39: Permission denied
Cannot stat file /proc/2334/fd/40: Permission denied
Cannot stat file /proc/2334/fd/41: Permission denied
Cannot stat file /proc/2334/fd/101: Permission denied
Cannot stat file /proc/2334/fd/102: Permission denied
Cannot stat file /proc/2334/fd/1023: Permission denied
Created symlink /etc/systemd/system/multi-            
user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (5.7.23-0ubuntu0.18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for ureadahead (0.100.0-20) ...
Amit Singh Gaur
  • 141
  • 2
  • 5
  • Did you find a solution to this? – JacobTheDev Sep 19 '18 at 03:49
  • @JacobTheDev Yeah but the temporary one. Create a new user with username same as your ubuntu username and then grant all access to it. – Amit Singh Gaur Sep 24 '18 at 23:37
  • 3
    @JacobTheDev I came across this, leaving the link FYI: https://stackoverflow.com/a/50746032/1690339 – DineshKP Nov 20 '18 at 15:37
  • 1
    And if it will help, here is a tutorial on configuring mysql native authentication https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04 - check step 3 – DineshKP Nov 20 '18 at 15:50
  • That error shows when trying to install or after installing, when trying to access to the mysql console?. Why don't you try with mariadb instead of mysql? – evening_g May 22 '21 at 03:20

2 Answers2

0

I've encounter similar issue trying to reinstall mysql on my machine. But in my case I've got only one message:

Cannot stat file /proc/5346/fd/1023: Permission denied

Using dpkg --list | grep mysql I've found out which packages I need to remove:

$ sudo apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0

But it asked if I want to remove the next packages as dependent:

The following packages will be REMOVED:
  budgie-desktop* budgie-desktop-environment* colord* glewlwyd* gnome-control-center* hpijs-ppds* hplip* hplip-gui* libdbd-mysql-perl*
  libhoel1.4* libhpmud0* libmailutils6* libmysqlclient-dev* libmysqlclient21* libsane* libsane-dev* libsane-hpaio* libsnmp-dev*
  libsnmp35* mailutils* mysql-client-8.0* mysql-client-core-8.0* mysql-common* mysql-server-8.0* mysql-server-core-8.0*
  printer-driver-hpcups* printer-driver-hpijs* sane-utils* simple-scan* snmp* sysbench* xsane*

Try to do the same and save these packages string somewhere on your drive. For example, I've saved them in ~/packages file, removing asterisks and line breaks.

$ cat packages 
budgie-desktop budgie-desktop-environment colord glewlwyd gnome-control-center hpijs-ppds hplip hplip-gui libdbd-mysql-perl libhoel1.4 libhpmud0 libmailutils6 libmysqlclient-dev libmysqlclient21 libsane libsane-dev libsane-hpaio libsnmp-dev libsnmp35 mailutils mysql-common printer-driver-hpcups printer-driver-hpijs sane-utils simple-scan snmp sysbench xsane

So I realized the issue. It asks to remove some desktop environment packages. It means, if you purge or remove mysql packages, some its files are still in use, so they could not be removed.

To reinstall mysql packages properly:

  • Stop your display manager (it could be gdm3, lightdm, xdm, etc.):

      $ sudo systemctl stop gdm3
    
  • Switch to some terminal by pressing: Ctrl+Alt+F3

  • Log in

  • Purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0

  • Reboot

  • Switch to the third terminal, log in and stop your display manager

  • Install all removed packages back:

      $ sudo apt install $(cat ~/packages)
    
  • Start your display manager

      $ sudo systemctl start gdm3
    

And, as a result, I reinstalled mysql packages without that error.

I've also had other mysql server installed to not standard folder on 3306 port, so I have been required to change my newly installed mysql-server listening port to something else in /etc/mysql/mysql.conf.d/mysqld.cnf file.

Gryu
  • 7,559
  • 9
  • 33
  • 52
-1

If you are installing mysql-server on windows subsystem ubuntu18, then you can directly go to install ubuntu1604. I've tried a lot of solution but only on ubuntu1604 I can apt-get install mysql-server normally. Meanwhile, if you have installed mysql software before on your windows 10, you should uninstalled win10 mysql first somehow. ( I don't know the reason)

After all of that, try the following commands

sudo apt purge mysql*
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
sudo apt autoremove
sudo apt install mysql-server
phiz
  • 1