On Linux, almost all processes (including servers and daemon programs) are started with a fork(2) (sometimes implemented in your standard C library using clone(2)) often followed by execve(2) syscall. The daemon(3) library function use these (and some few others) syscalls (listed in syscalls(2)....)
The only exceptions are a few processes magically started by the kernel. These include:
/sbin/init, which could be systemd these days, but you can boot your kernel and pass
init=/bin/bash to it thru GRUB) which is started at kernel initialization.
some very few programs started magically by the kernel (when some external event occurs), e.g. sometimes modprobe, hotplug, etc....
init existed in 1980 era Unixes (e.g. SunOS3). AFAIK, automagically started
hotplug-like processes are a recent Linux addition (probably Linux 3, or at least 2.6, see also udev)
Most programs and processes (including
mysqld) are all descendants of
You basically can ignore the exceptions (like
hotplug), and you could have a Linux system where every process is descendant of
init (that was the case with Linux 1.x kernels in the previous century). Use pstree(1) to see the tree of processes.
Read wikipage about Linux startup process & From PowerUp to Bash Prompt (which might be slightly outdated, but most of it is still true).
setuid is a clever mechanism related to privileges (see also setreuid(2), credentials(7), capabilities(7), namespaces(7)).
I recommend reading Advanced Linux Programming at first. Some few features or syscalls appeared after that book (e.g. signalfd(2), inotify(7), epoll(7) ....).