MySQL-5.1.72 安装编译过程及报错解决
./configure \
--prefix=/application/mysql5.1.72 \
--with-unix-socket-path=/application/mysql5.1.72/tmp/mysql.sock \
--localstatedir=/application/mysql5.1.72/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
#--with-plugin-PLUGIN \
报错记录:
checking for termcap functions library... configure: error: No curses/termcap library found
解决方法:
yum install ncurses-devel -y
make && make install
[root@acs421 mysql-5.1.72]# ln -sv /application/mysql5.1.72/ /application/mysql
`/application/mysql' -> `/application/mysql5.1.72/'
[root@acs421 mysql-5.1.72]#
[root@acs421 mysql-5.1.72]# ls -lah /application/mysql
lrwxrwxrwx. 1 root root 25 Oct 18 22:20 /application/mysql -> /application/mysql5.1.72/
[root@acs421 mysql-5.1.72]#
[root@acs421 support-files]# ls my*.cnf
my-huge.cnf my-innodb-heavy-4G.cnf my-large.cnf my-medium.cnf my-small.cnf
[root@acs421 support-files]#
[root@acs421 support-files]# cp my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@acs421 support-files]#
mkdir /application/mysql/data
chown -R mysql.mysql /application/mysql/
/application/mysql/bin/mysql_install_db --basedir=/application//mysql --datadir=/application/mysql/data/ --user=mysql
[root@acs421 support-files]# tree /application/mysql/data/
/application/mysql/data/
|-- mysql
| |-- columns_priv.MYD
| |-- columns_priv.MYI
| |-- columns_priv.frm
| |-- db.MYD
| |-- db.MYI
| |-- db.frm
| |-- event.MYD
| |-- event.MYI
| |-- event.frm
| |-- func.MYD
| |-- func.MYI
| |-- func.frm
| |-- general_log.CSM
| |-- general_log.CSV
| |-- general_log.frm
| |-- help_category.MYD
| |-- help_category.MYI
| |-- help_category.frm
| |-- help_keyword.MYD
| |-- help_keyword.MYI
| |-- help_keyword.frm
| |-- help_relation.MYD
| |-- help_relation.MYI
| |-- help_relation.frm
| |-- help_topic.MYD
| |-- help_topic.MYI
| |-- help_topic.frm
| |-- host.MYD
| |-- host.MYI
| |-- host.frm
| |-- ndb_binlog_index.MYD
| |-- ndb_binlog_index.MYI
| |-- ndb_binlog_index.frm
| |-- plugin.MYD
| |-- plugin.MYI
| |-- plugin.frm
| |-- proc.MYD
| |-- proc.MYI
| |-- proc.frm
| |-- procs_priv.MYD
| |-- procs_priv.MYI
| |-- procs_priv.frm
| |-- servers.MYD
| |-- servers.MYI
| |-- servers.frm
| |-- slow_log.CSM
| |-- slow_log.CSV
| |-- slow_log.frm
| |-- tables_priv.MYD
| |-- tables_priv.MYI
| |-- tables_priv.frm
| |-- time_zone.MYD
| |-- time_zone.MYI
| |-- time_zone.frm
| |-- time_zone_leap_second.MYD
| |-- time_zone_leap_second.MYI
| |-- time_zone_leap_second.frm
| |-- time_zone_name.MYD
| |-- time_zone_name.MYI
| |-- time_zone_name.frm
| |-- time_zone_transition.MYD
| |-- time_zone_transition.MYI
| |-- time_zone_transition.frm
| |-- time_zone_transition_type.MYD
| |-- time_zone_transition_type.MYI
| |-- time_zone_transition_type.frm
| |-- user.MYD
| |-- user.MYI
| `-- user.frm
`-- test
2 directories, 69 files
[root@acs421 support-files]#
cp /usr/local/src/mysql-5.1.72/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
/etc/init.d/mysqld start
Starting mysqld: [ OK ]
[root@acs421 support-files]#
[root@acs421 support-files]# netstat -ntulp|grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1442/mysqld
[root@acs421 support-files]#
[root@acs421 support-files]# vi /etc/profile
[root@acs421 support-files]# tail -1 /etc/profile
PATH="/application/mysql/bin/:$PATH"
[root@acs421 support-files]#
[root@acs421 support-files]# . /etc/profile
报错:
[root@acs421 extra]# /etc/init.d/mysqld start
Starting MySQL......Manager of pid-file quit without updati[FAILED]
解决方法:
[root@acs421 extra]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
77G 6.8G 66G 10% /
tmpfs 495M 0 495M 0% /dev/shm
/dev/sda1 485M 40M 420M 9% /boot
[root@acs421 extra]# vi /etc/init.d/mysqld
basedir=/application/mysql
datadir=/application/mysql/data
[root@acs421 extra]# vi /etc/my.cnf
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /application/mysql/data
编译之后忘记安装:
/application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql
[root@acs421 extra]# /etc/init.d/mysqld restart
MySQL manager or server PID file could not be found! [FAILED]
Starting MySQL. [ OK ]
[root@acs421 extra]# /etc/init.d/mysqld restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
。