I installed MySql via Yast in 10.3. After I start up the machine mysql isn’t running and when I try to start it I get this error: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
If I reinstall MySQL and set up the root password it works until I log back in.
I don’t really need it running every time I start my machine. How do I manually start it and if I want force it to run on boot? The Mysql entry on this site assumes that by installing through yast and setting the password means that all is well so there is no other information.
Probably didn’t work because you didn’t have /sbin and /usr/sbin on your $PATH. su by itself won’t change $PATH, but if you do su -, you will get root’s $PATH and chrysantine’s suggestions will work. Or specify the absolute path:
I was root and they didn’t work.not with su or with sudo. sudo doesn’t run many root programs, ifconfig and iwconfig to name two.
su - did work
We have learned today that su or sudo won’t run everything. Apparently su - will.
I don’t use Apache so no worries there. I only use MySQL to test a few rails apps running in mongrel.
Why in the heck are the mysql files scattered all over the file system and there are so many ways to start it? That is not indicative of good design. Mysql isn’t the only offender. The number of places that crap for java is scattered around is even worse.
The official way that works on all Linux systems because it’s a standard.
/etc/init.d/mysql start
The SUSE shortcut, very handy:
rcmysql start
If you look carefully, /usr/sbin/rcmysql is just a symlink to /etc/init.d/mysql.
The RedHat way, which I think is poorer than the SUSE way, because you can’t use file completion, copied by SUSE for making RedHat refugees feel at home.
service mysql start
service is just a shell script juggles its arguments to give you effectively the first way.
If you don’t want to know all this, just remember the first way.