1、[root@localhost media]# rpm -ivh MySQL-community-5.1.50-1.rhel5.src.rpm 
error: cannot create %sourcedir /usr/src/redhat/SOURCES

出现error: cannot create %sourcedir /usr/src/redhat/SOURCES错误,是权限的问题,可以使用mkdir /usr/src/redhat/SOURCES,建立文件后,再使用chmod 777 SOURCES来放开SOURCES的权限,然后安装RPM包就可以正常安装了

[root@localhost media]# mkdir -p /usr/src/redhat/SOURCES
[root@localhost media]# cd /usr/src/redhat/
[root@localhost redhat]# chmod 777 SOURCES/
[root@localhost redhat]# ll
总计 8
drwxrwxrwx 2 root root 4096 03-11 01:15 SOURCES
[root@localhost media]# rpm -ivh MySQL-community-5.1.50-1.rhel5.src.rpm 
   1:MySQL-community        warning: user mysqldev does not exist - using root
warning: group mysqldev does not exist - using root
warning: user mysqldev does not exist - using root
warning: group mysqldev does not exist - using root
########################################### [100%]

2、checking for termcap functions library... configure: error: No curses/termcap library found

解决办法:

查看termcap的安装包

[root@localhost mysql-5.0.56]# rpm -qa | grep termcap
libtermcap-2.0.8-46.1
termcap-5.5-1.20060701.1

安装termcap开发包

[root@localhost /]# yum -y install libtermcap-devel
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
server                                                   | 1.3 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libtermcap-devel.i386 0:2.0.8-46.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                  Arch         Version             Repository      Size
================================================================================
Installing:
 libtermcap-devel         i386         2.0.8-46.1          server          56 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 56 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libtermcap-devel                                         1/1 

Installed:
  libtermcap-devel.i386 0:2.0.8-46.1                                            

Complete!

检查包的安装情况

[root@localhost /]# rpm -qa | grep termcap
libtermcap-2.0.8-46.1
libtermcap-devel-2.0.8-46.1
termcap-5.5-1.20060701.1

3、[root@localhost mysql-5.0.56]# mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决办法:

[root@localhost mysql-5.0.56]# /etc/init.d/mysqld stop
Shutting down MySQL                                        [确定]

[root@localhost mysql-5.0.56]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 365
[root@localhost mysql-5.0.56]# Starting mysqld daemon with databases from /usr/local/mysql/var

登陆mysql,然后执行下面语句:
set password for `root`@`localhost`=password(``);
flush privileges;

[root@localhost mysql-5.0.56]# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.56-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for `root`@`localhost`=password(``);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '``)' at line 1
mysql> flush privileges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'flush privileges' at line 2
mysql> quit
Bye

[root@localhost mysql-5.0.56]# /etc/init.d/mysqld start
Starting MySQL                                             [确定]
[root@localhost mysql-5.0.56]# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.56-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
 
问题已解决!

4、
make[3]: Leaving directory `/usr/src/mysql-5.1.50/mysql-test/lib/My/SafeProcess'
make[2]: Leaving directory `/usr/src/mysql-5.1.50/mysql-test/lib/My/SafeProcess'
make[2]: Entering directory `/usr/src/mysql-5.1.50/mysql-test'
make[3]: Entering directory `/usr/src/mysql-5.1.50/mysql-test'
make[3]: Nothing to be done for `install-exec-am'.
make    INSTALL_TO_DIR="/usr/local/mysql/mysql-test" install_test_files
make[4]: Entering directory `/usr/src/mysql-5.1.50/mysql-test'

在编译的时候,在这个阶段需要等一段时间,不是卡住了,该过程没有回显,所以感觉时间很长。