Where is mysql installed in suse 11?

Hi,

I’m from a windows background (Please don’t throw stones at me!!) and pretty new to this Linux thing.

I’ve managed to get Suse 11 up and running fairly easily from the DVD (although I had to copy it to a hard drive because my DVD reader was iffy). I’ve installed the text only version as I intend the machine to be a LAMP server and therefore does not require a GUI.

I installed the MySQL package using YAST, no Problem.

Configured it using instructions from How to install MySQL on SuSE Linux :: laffers.net (created mysql table etc), no problem either.

My problem is that I cannot find where YAST has put the MySQL directory and therefore where the my.conf file should be. Laffers imply that the path should be /usr/local/mysql/ but I’ve looked in /usr/local/ and there’s no mysql. They are installing on suse 10, are things different with 11 or am I missing something really big.

The server works if I simply type “mysqld --user=root &” at the prompt (no need to qualify the path to the executable)

Thanks for any help

e

my.cnf is located in /etc

if you want to see all the files of the mysql RPM, then open up a console and type:

rpm -qal mysql

Throws a stone at him, nah just kidding, we Linux guys are one with the world ;).

OpenSUSE, including other Linux repos, does not install MySQL in the /usr/local directory, it installs it system-wide instead.

So your my.cnf should be located here: /etc/my.cnf,
your MySQL libraries here: /usr/lib/mysql,
and binaries here: /usr/bin

Note: you’ll need to open my.cnf with root access to edit it, like this:

  1. Open a terminal
  2. sudo gedit /etc/my.cnf (Gnome), sudo kwrite /et/my.cnf (KDE)
  3. Enter password and press ENTER, or the RETURN button for you Windows users :wink:

I know how you feel when coming to Linux for the first time, I like the software files to be kept in the same place instead of all over the system. That’s also the reason why I install server software manually in production mode.

And this is the wrong way to start/stop a service. You should always use the scripts in /etc/init.d, like this:

/etc/init.d/mysql start

or simpler in SUSE,

rcmysql start

and so forth for stop, restart, status, etc.

When you do it this way, then you will find that it will pay attention to /etc/my.cnf. Not to mention run more safely because it won’t run as root but as the mysql user. You may have already messed up the ownership of files in /var/lib/mysql by starting it the wrong way. You should change those files back to being owned by the mysql account.

Of course, service control can also be done from YaST.

On Fri, 04 Jul 2008 11:26:04 GMT
EarthMind <EarthMind@no-mx.forums.opensuse.org> wrote:

>Note: you’ll need to open my.cnf with root access to edit it, like
>this:
>1. Open a terminal
>2. sudo gedit /etc/my.cnf (Gnome), sudo kwrite /et/my.cnf (KDE)
>3. Enter password and press ENTER, or the RETURN button for you Windows
>users :wink:
>

He can’t use either of those editors (gedit/kwrite) since he is at
command line only. He can try ‘joe’ or ‘nano’ or ‘pico’. I think at
least one of those is installed by openSUSE. Coming from a Windows
background, he probably doesn’t want to tackle ‘vi’ just yet . . . :slight_smile:


Kevin Nathan (Arizona, USA)
Linux is not a destination, it’s a journey – enjoy the trip!

Linux 2.6.22.18-0.2-default
1:03pm up 11:08, 21 users, load average: 2.67, 1.70, 1.22

Woups, missed that part of his post. Good idea to keep him away from vim for now.

If you ensure that both mysqld and apache are checked in System Services within Yast, mysql will automatically be available whenever you boot.

For all practical purposes you don’t need to know where anything is because all you need to do is open a console and enter
mysql -u username -p

(On the first occasion enter mysql -u root and set the permissions before you do anything else).

mysql root is not the same as Linux root and you will find you are blocked from using mysql as Linux root for security reasons.

For the help file, enter
info mysql

Thasnks everyone for your help and suggestions. I now have MySQL, Apache and PHP installed and working (Yay!!!). My next tasks are to make them secure!:eek:
This is a ‘home’ project for me and I only spend a couple of hours each evening on it which is why my progress may seem a little slow. I have re-installed the system several times (since it only takes 10 mins or so to get the base system up) and have been taking detailed notes each time. I will stick them on the web when I’ve finished, hopefully they may be of use to someone.

He can try ‘joe’ or ‘nano’ or ‘pico’. I think at
least one of those is installed by openSUSE. Coming from a Windows
background, he probably doesn’t want to tackle ‘vi’ just yet . . . :slight_smile:

Before working with windows, I did a lot of work in DOS, all we had then was edlin!!! VI is brilliant for a text mode only editor. One of the reasons for building this system WITHOUT a GUI was so that I could get some experience of tools like VI. (The other reason was that I believe a webserver that is going to sit in a corner and mind it’s own business for the rest of its life doesn’t require one)

Thanks again

e