- 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
- Create user, Basedir DataDir
Useradd-s/sbin/nologin MySQL
Mkdir-p/usr/local/mysql
Mkdir-p/data/mysql
Chown Mysql/data/mysql
- 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*
- Compiling make
- Install make install
- Copy MySQL configuration file cp support-files/my-medium.cnf/etc/my.cnf
- Initializes the database./scripts/mysql_install_db--user=mysql--datadir=/data/mysql/
- Copy startup script CP Support-files/mysql.server/etc/init.d/mysqld
- Modify the permissions and set the boot up.
chmod 755/etc/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on
- Start MySQL service/etc/init.d/mysqld start
- Set MySQL password mysqladmin-uroot password ' 123456 '
- 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)