• Do it yourself
  • Error with MySQL binary installation.

    Most common error in MySql binary installation is
    /usr/local/mysql# scripts/mysql_install_db –user=mysql
    FATAL ERROR: Could not find mysqld
    The following directories were searched:
        /usr/libexec
        /usr/sbin
        /usr/bin
    If you compiled from source, you need to run ‘make install’ to
    copy the software into the correct location ready for operation.
    If you are using a binary release, you must either be at the top
    level of the extracted archive, or pass the –basedir option
    pointing to that location.
    Assuming you are installing the MySql binaries into /usr/local using following commands
    shell> groupadd mysql
    shell> useradd -r -g mysql mysql
    shell> cd /usr/local
    shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
    shell> ln -s full-path-to-mysql-VERSION-OS mysql
    shell> cd mysql
    shell> chown -R mysql .
    shell> chgrp -R mysql .
    shell> scripts/mysql_install_db –user=mysql
    shell> chown -R root .
    shell> chown -R mysql data
    Now try with the –basedir option as shown below
    scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql
    The next probable error is
    Installing MySQL system tables…
    /usr/local/mysql/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
    Type the following command
    sudo apt-get install libaio1
    apt-get install libaio-dev
    scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql

    you will get the message

    Installing MySQL system tables…
    OK
    Filling help tables…
    OK
    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /usr/local/mysql/bin/mysqladmin -u root password ‘new-password’
    /usr/local/mysql/bin/mysqladmin -u root -h rohit-Pc password ‘new-password’
    Alternatively you can run:
    /usr/local/mysql/bin/mysql_secure_installation
    which will also give you the option of removing the test
    databases and anonymous user created by default.  This is
    strongly recommended for production servers.
    See the manual for more instructions.
    You can start the MySQL daemon with:
    cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
    You can test the MySQL daemon with mysql-test-run.pl
    cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
    Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    2 mins