Como instalar o MySQL e SQL server no Endless?

Gostaria de instalar os SGBD MySQL, SQLServer e o NoSQL Mongo DB no notebook. Na loja de app encontrei o Mongo DB Compass, mas os outros só no site oficial. No site mysql.com, não encontro opção para instalação na distro Endless OS, mas encontro opção “Linux Generic” imagino que seja essa, mas quis confirmar com a comunidade.

You need to run the Docker image provided for MySQL and MonoDB.

https://hub.docker.com//mysql
https://hub.docker.com/
/mongo

Follow the instructions there, they should work out of the box on Endless OS.

SQL Server is not available as it’s a Microsoft Windows based Product.

1 Like

Tentei várias vezes instalar, mas sempre aparece “comando não encontrado”. Tem tutoriais para distro Ubuntu e Debian, mas não consegui instalar usando esses comandos.Poderia me ajudar por favor?Quase desisti da instalação, mas realmente necessito disso.

Sorry, that was my fault. The command in question on Endless OS is podman. Previously there was a alias for docker to podman but that has been changed.

Run a MySQL instance

podman run --name mysql --network=host -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0.30

Note that this command will only work the first time you run it, as it specifies additional parameters which image to pull in. On subsequent runs (e.g. after you reboot your machine), use the following command:

podman start mysql

Connect to the running instance

podman run -it --rm --network=host mysql:8.0.30 mysql --user=root --password=root --host=127.0.0.1

Please also note that the above examples are insecure as they bind the MySQL server to your machines IP address with a bad password. But it should point you to the direction to go to.

Você não tem culpa de nada, imagina! Muito obrigada por ajudar a comunidade.
Com esses comandos a minha máquina fica vulnerável?
Vou tentar e ver se consigo descobrir uma forma de fazer isso sem deixar a minha máquina vulnerável.

No it’s not vulnerable outside of your network (e.g. from the internet). Only other users on the same network (people connected to the same wifi) can access the MySQL instance as the password in my example is very weak. I would also recommend you to use another password for the root account of MySQL, something strong but still memorizable.

/edit:

If you already run the first command (creating the mysql instance), you need to delete the container first to start from scratch:

podman container stop mysql
podman container rm mysql
1 Like

Acho que eu sou muito ignorante, pois os comandos não funcionam comigo :sweat_smile:. Este comando dá erro: podman run -it --rm --network=host mysql:8.0.30 mysql --user=root --password=root --host=127.0.0.1

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user ‘root’@‘127.0.0.1’ (using password: YES)

Esqueci de dizer que busquei uma opção no Stackoverflow, mas nada funciona.

This message is in fact good in the first place, it shows that the MySQL server is running, but you are trying to connect with the wrong password. The password you give with –password= has to be the same you have given as MYSQL_ROOT_PASSWORD= on the creation of the service.

I just tried the commands above on a clean installation and they worked. In doubt, start from scratch by issuing the commands i gave in my previous post (podman container stop, …)

1 Like

A senha estava errada e agora com a senha certa funcionou. Muito obrigada!
Para o mongo db acrescentei o comando: podman run --name mongo --network=host -d mongo:6.0.1-focal
Em seguida: ```
$ podman run -it --network some-network --rm mongo mongosh --host mongo --network=host

Então aparece Error: error stat’ing file /sysroot/home/luciana/.config/cni/net.d: No such file or directory: OCI not found

For some unknown reasons mongosh needs to be run with it’s full path … don’t know why but i’m too lazy to dig deeper :slight_smile:

Run a MongoDB instance

podman run --name mongo --network=host -d mongo:focal

As before, on subsequent runs, just use

podman start mongo

Connect to the MongoDB instance

podman run -it --rm --network=host mongo:focal /usr/bin/mongosh --host=127.0.0.1 test
2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.