Re: [SLUG] MySQL - how do you fire this thing up?

From: Eric Jahn (eric@ejahn.net)
Date: Wed May 14 2003 - 10:18:08 EDT


to fire up the daemon, I have to currently do that as root:

localhost root # /etc/init.d/mysql start
localhost root # * Starting mysqld... [ ok ]

If you're running redhat, I recall there was a service start/stop button
in the main redhat menu.

I'm not sure how to change the daemon to allow user restarts (even
though my normal user has otherwise full privileges to the mysql
databases). I guess it would be to modify the execute privileges on the
/etc/init.d/mysql file, or add my user to a "mysql" group.

search for the tutorial section in the mysql manual; it's pretty useful
for the other commands. here's where the manual installed itself on my
computer: /usr/share/doc/mysql-3.23.56/html/manual_toc.html
Below is a snippet that might be of use:

________________________________________
2.2.10 Installing a MySQL Binary Distribution
See also section 2.1.2.1 Installing the Binaries, section 2.1.1
Installing MySQL on Linux, and section 8.4.7 Building Client Programs.

You need the following tools to install a MySQL binary distribution:

      * GNU gunzip to uncompress the distribution.
      * A reasonable tar to unpack the distribution. GNU tar is known to
        work. Sun tar is known to have problems.
An alternative installation method under Linux is to use RPM-based (RPM
Package Manager) distributions. See section 2.1.1 Installing MySQL on
Linux.

If you run into problems, please always use mysqlbug when posting
questions to mysql@lists.mysql.com. Even if the problem isn't a bug,
mysqlbug gathers system information that will help others solve your
problem. By not using mysqlbug, you lessen the likelihood of getting a
solution to your problem! You will find mysqlbug in the `bin' directory
after you unpack the distribution. See section 1.6.1.3 How to Report
Bugs or Problems.

The basic commands you must execute to install and use a MySQL binary
distribution are:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/safe_mysqld --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x

You can add new users using the bin/mysql_setpermission script if you
install the DBI and Msql-Mysql-modules Perl modules.

A more detailed description follows.

To install a binary distribution, follow these steps, then proceed to
section 2.4 Post-installation Setup and Testing, for post-installation
setup and testing:

     1. Pick the directory under which you want to unpack the
        distribution, and move into it. In the following example, we
        unpack the distribution under `/usr/local' and create a
        directory `/usr/local/mysql' into which MySQL is installed. (The
        following instructions, therefore, assume you have permission to
        create files in `/usr/local'. If that directory is protected,
        you will need to perform the installation as root.)
     2. Obtain a distribution file from one of the sites listed in
        section 2.2.1 How to Get MySQL. MySQL binary distributions are
        provided as compressed tar archives and have names like
        `mysql-VERSION-OS.tar.gz', where VERSION is a number (for
        example, 3.21.15), and OS indicates the type of operating system
        for which the distribution is intended (for example,
        pc-linux-gnu-i586).
     3. If you see a binary distribution marked with the -max suffix,
        this means that the binary has support for transaction-safe
        tables and other features. See section 4.7.5 mysqld-max, An
        Extended mysqldServer. Note that all binaries are built from the
        same MySQL source distribution.
     4. Add a user and group for mysqld to run as:
        
        shell> groupadd mysql
        shell> useradd -g mysql mysql
        These commands add the mysql group and the mysql user. The
        syntax for useradd and groupadd may differ slightly on different
        versions of Unix. They may also be called adduser and addgroup.
        You may wish to call the user and group something else instead
        of mysql.
     5. Change into the intended installation directory:
        
        shell> cd /usr/local
     6. Unpack the distribution and create the installation directory:
        
        shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
        shell> ln -s full-path-to-mysql-VERSION-OS mysql
        The first command creates a directory named `mysql-VERSION-OS'.
        The second command makes a symbolic link to that directory. This
        lets you refer more easily to the installation directory as
        `/usr/local/mysql'.
     7. Change into the installation directory:
        
        shell> cd mysql
        You will find several files and subdirectories in the mysql
        directory. The most important for installation purposes are the
        `bin' and `scripts' subdirectories.
        
        `bin'
        
        This directory contains client programs and the server You
        should add the full pathname of this directory to your PATH
        environment variable so that your shell finds the MySQL programs
        properly. See section F Environment Variables.
        
        `scripts'
        
        This directory contains the mysql_install_db script used to
        initialise the mysql database containing the grant tables that
        store the server access permissions.
     8. If you would like to use mysqlaccess and have the MySQL
        distribution in some non-standard place, you must change the
        location where mysqlaccess expects to find the mysql client.
        Edit the `bin/mysqlaccess' script at approximately line 18.
        Search for a line that looks like this:
        
        $MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
        Change the path to reflect the location where mysql actually is
        stored on your system. If you do not do this, you will get a
        Broken pipe error when you run mysqlaccess.
     9. Create the MySQL grant tables (necessary only if you haven't
        installed MySQL before):
        
        shell> scripts/mysql_install_db
        Note that MySQL versions older than Version 3.22.10 started the
        MySQL server when you run mysql_install_db. This is no longer
        true!
    10. Change ownership of binaries to root and ownership of the data
        directory to the user that you will run mysqld as:
        
        shell> chown -R root /usr/local/mysql/.
        shell> chown -R mysql /usr/local/mysql/data
        shell> chgrp -R mysql /usr/local/mysql/.
        The first command changes the owner attribute of the files to
        the root user, the second one changes the owner attribute of the
        data directory to the mysql user, and the third one changes the
        group attribute to the mysql group.
    11. If you want to install support for the Perl DBI/DBD interface,
        see section 2.7 Perl Installation Comments.
    12. If you would like MySQL to start automatically when you boot
        your machine, you can copy support-files/mysql.server to the
        location where your system has its startup files. More
        information can be found in the support-files/mysql.server
        script itself and in section 2.4.3 Starting and Stopping MySQL
        Automatically.
After everything has been unpacked and installed, you should initialise
and test your distribution.

You can start the MySQL server with the following command:

shell> bin/safe_mysqld --user=mysql &
Now proceed to section 4.7.2 safe_mysqld, The Wrapper Around mysqld, and
See section 2.4 Post-installation Setup and Testing.

On Wed, 2003-05-14 at 09:03, John Clay wrote:
> I've just loaded mysql like so:
>
> rpm -ivh /home/jmc/MySQL/mysql-3.23.49-3.i386.rpm
>
> Then:
>
> rpm -q mysql
>
> Gives:
>
> mysql-3.23.49-3
>
> But Now:
>
> I can't find any daemon (mysqld) to execute. I did a find for mysqld on
> entire drive and got nothing. Then I did a find for mysql on entire
> drive and got:
>
> /usr/lib/mysql
> /usr/share/mysql
> /usr/bin/mysql
>
> If I issue command: mysql
>
> I get: Can't connect to local mysql server through socket
> "/var/lib/mysql/mysql.sock"
>
> Any suggestions?
>
> Thanks
> John Clay
> Tallahassee, FL



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:50:38 EDT