mysqld, net start mysql

Discussion in 'Networking and Security' started by silveredge, Oct 7, 2019.

  1. In Windows, I have been going to services.msc and starting mysql server there manually every time i wanna use mysql. Seems that it can be started from the promt by mysqld --console. Can someone clarify what is 'mysqld' and 'net start mysql' do? starting the daemon by mysqld is equivalent to starting the mysql service?
  2. DaveV


  3. What does Net Start Mysql do? Some people seem to suggest they do similar things, a bit confused
  4. Baron

    Baron ET Founder

    Technically there are two components. There's mysqld, which is the actual database server application that is always listening for incoming connection requests. When you type "net start Mysql" you are starting the mysqld database server.

    Once the database server is running, you can connect to it using the MySQL client application, which is the application called mysql.exe that is usually included in your download of the whole MySQL package.

    Just keep in mind that once mysqld is running, you don't necessarily have to connect to it using the mysql client. You could use any software which has the proper credentials set up to access whatever database you've set up.

    And the reason it's split up into two parts is for multiple users to be able work on the same server at the same time. So you could access the database server from your desktop, and I could log into your database server as well using whatever software I have and assuming you gave me the correct login info.

    Hope that helps.
    DaveV and silveredge like this.
  5. Can you pls elaborate on these two, which is where I don't get. So when you type mysqld, it doesn't start the daemon? then what does it do?
  6. Baron

    Baron ET Founder

    There are two ways to start it. Typing mysqld does start the daemon (database server), but when you start it manually like that, it will be stopped automatically whenever you log out. When you run it as a service using the 'net start' command, you are starting mysqld as a service running in the background, which means it continues to run even when you're logged out of the computer. If you're the only person who will be using it, then starting it either way will suffice. Just be mindful that if you start it by typing mysqld then you may need to restart it again each time you log into your computer.
  7. gaussian


    @Baron gave a fine explanation of what is going on. I'd like to add that if you have a little more technical know-how you can spare your system and run a docker container with persistent storage. Far easier to start/shutdown, and far, far easier to load onto something like AWS through the ECS.
    blueraincap and silveredge like this.
  8. I guess container technology isn't relevant for someone whose DB server and JDBC client reside in the same pc?
  9. gaussian


    I run minikube and manage everything local through containers. Contaminating your system with garbage from services isn't smart.