How to install MySQL community server on Debian 9 Stretch Linux - LinuxConfig.org


#1

Head over to https://dev.mysql.com/downloads/repo/apt/ and download the latest MySQL APT Repository package. Example:


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-install-mysql-community-server-on-debian-9-stretch-linux

#2

chris duty

“sudo apt-get install aptitude”
“sudo aptitude install mysql-server”

I had conflicts due to mariadb components, aptitude removed the conflicts and installed mysql.

The following actions will resolve these dependencies:

Remove the following packages:

  1. default-mysql-client-core [1.0.2 (now, stable)]
  2. default-mysql-server-core [1.0.2 (now, stable)]
  3. mariadb-client-core-10.1 [10.1.26-0+deb9u1 (now, stable)]
  4. mariadb-server-core-10.1 [10.1.26-0+deb9u1 (now, stable)]

#3

Gerardo Maduro

Hi, I try “sudo apt -f install”, and have the next error:

sudo apt -f install
Leyendo lista de paquetes… Hecho
Creando árbol de dependencias
Leyendo la información de estado… Hecho
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 0 no actualizados.
2 no instalados del todo o eliminados.
Se utilizarán 0 B de espacio de disco adicional después de esta operación.
Configurando mariadb-server-10.1 (10.1.26-0+deb9u1) …
dpkg: error al procesar el paquete mariadb-server-10.1 (–configure):
el subproceso instalado el script post-installation devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de default-mysql-server:
default-mysql-server depende de mariadb-server-10.1; sin embargo:
El paquete `mariadb-server-10.1’ no está configurado todavía.

dpkg: error al procesar el paquete default-mysql-server (–configure):
problemas de dependencias - se deja sin configurar
Se encontraron errores al procesar:
mariadb-server-10.1
default-mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


#4

Gerardo Maduro -> Gerardo Maduro

My bad, I try to install “mysql-server” with “sudo” command!! (sudo apt install mysql-server)


#5

David Steven Rojas

Thanks for the post. I was not asked for a password during the installation, when I try to run

mysql -p, it asks for a password, empty pass did not work, is there a file to get the pass from? or any default?

Thanks,
David R


#6

JP -> David Steven Rojas

Actually he ran the mysql -p in super user mode.

Try run sudo mysql -p


#7

Stanimir Marinov

Selecting previously unselected package mysql-community-server.
Preparing to unpack …/4-mysql-community-server_5.7.19-1debian9_amd64.deb …

dpkg: error processing archive /tmp/apt-dpkg-install-ZPyeVr/4-mysql-community-server_5.7.19-1debian9_amd64.deb (–unpack):
subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package mysql-server.
Preparing to unpack …/5-mysql-server_5.7.19-1debian9_amd64.deb …
Unpacking mysql-server (5.7.19-1debian9) …
Errors were encountered while processing:
/tmp/apt-dpkg-install-ZPyeVr/4-mysql-community-server_5.7.19-1debian9_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


#8

Alex No -> Stanimir Marinov

Hello!

Try ‘apt -f install’


#9

Stanimir Marinov

Preparing to unpack …/mysql-community-server_5.7.19-1debian9_amd64.deb …

dpkg: error processing archive /var/cache/apt/archives/mysql-community-server_5.7.19-1debian9_amd64.deb (–unpack):
subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package mysql-server.
Preparing to unpack …/mysql-server_5.7.19-1debian9_amd64.deb …
Unpacking mysql-server (5.7.19-1debian9) …
Errors were encountered while processing:
/var/cache/apt/archives/mysql-community-server_5.7.19-1debian9_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)