3

I was wondering what the difference is between mysql-server and mysql-client and came upon this stackoverflow post explaining the difference. I was curious if installing mysql-server also included mysql-client. So, after creating a fresh AWS Ubuntu instance, I ran which which mysqld and which mysql to confirm nothing came preinstalled with the AWS instance, and sure enough both commands returned nothing. However, after running sudo apt install mysql-server, when I ran which mysql and which mysqld they both returned something: which mysqld returned /usr/sbin/mysqld and which myself returned /usr/bin/mysql, suggesting that my installation of mysql-server installed both the client and the server. Is that accurate? As I mentioned, the stack overflow post I visited earliear indicated they were distinct pieces of software, so I'm wondering why installing mysql-server would install the client as well?

2
  • Yup. Check for yourself. sudo apt install -s mysql-server – KGIII Jan 17 at 2:55
  • +1 for the clarification of the difference between mysql and mysqld. I am not sure why mysql-server installs the client part as well but it looks logical: how can you use the server without at least one client? – Marc Vanhoomissen Jan 18 at 7:47
5

They are separate pieces of software, but installing mysql-server installs mysql-client as well, because you can use mysql-client to connect to the server, even over localhost. If you look at the package listing for mysql-server, you will see it depends on mysql-server-8.0, which depends on mysql-client-8.0, causing apt to install the client as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.