MySQL source installation (5.1)

Source: Internet
Author: User

  1. Download the MySQL source package and unzip it.
    wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
    TAR-ZXVF mysql-5.1.73
    CD mysql-5.1.73
  2. Create user, Basedir DataDir
    Useradd-s/sbin/nologin MySQL
    Mkdir-p/usr/local/mysql
    Mkdir-p/data/mysql
    Chown Mysql/data/mysql
  3. Pre-compilation parameter configuration
    ./configure--prefix=/usr/local/mysql
    There is an error message, you need to install the corresponding library file > Yum install-y gcc yum install-y gcc-c++ yum-y install ncurses* yum install-y LIBTERMCA p*
  4. Compiling make
  5. Install make install
  6. Copy MySQL configuration file cp support-files/my-medium.cnf/etc/my.cnf
  7. Initializes the database./scripts/mysql_install_db--user=mysql--datadir=/data/mysql/
  8. Copy startup script CP Support-files/mysql.server/etc/init.d/mysqld
  9. Modify the permissions and set the boot up.
    chmod 755/etc/init.d/mysqld
    Chkconfig--add mysqld
    Chkconfig mysqld on
  10. Start MySQL service/etc/init.d/mysqld start
  11. Set MySQL password mysqladmin-uroot password ' 123456 '
  12. Update environment variables
    vim/etc/profile/
    Path= $PATH:/usr/local/mysql/bin/
    source/etc/profile/

Second, the installation process error message

Hecking for termcap functions Library ... configure:error:No curses/termcap Library found
Installation:
NCURSES-DEVEL.***.RPM Package Solution
#cd/media/centos_5.5_final/centos/
#ls ncurses-devel*
Locate the package and install it using RPM.
# RPM-IVH ncurses-devel-5.5-24.20060715.i386.rpm
(or to download a ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz decompression and installation)

Two
Error when making
.. /depcomp:line 571:exec:g++: Not Found
MAKE[1]: * * [MY_NEW.O] Error 127
MAKE[1]: Leaving directory '/usr/local/src/mysql/mysql-5.1.73/mysys '
Make: * * [all-recursive] Error 1
Solve:
#yum install gcc-c++ can solve the problem.
To re-specify the installation path:
#./configure--prefix=/usr/local/mysql
Make
Make install
?

Three
Error initializing database:
# scripts/mysql_install_db--user=mysql
Or
#bin/mysql_install_db--basedir=/usr/local/mysql-5.1.54--datadir=/usr/local/mysql-5.1.54/data--user=mysql
[Warning] '--skip-locking ' is deprecated and would be removed in a future release. Please use '--skip-
External-locking ' instead.
?
(Workaround: Replace '--skip-locking ' in my.cnf with '--skip-external-locking '). )
?

MySQL source installation (5.1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.