1.下载
从官网上下载了SUSE版本的MySQL包MySQL-5.5.20-1.sles11.x86_64.tar。
SUSE是装在VMware里的,通过ftp把tar包传到SUSE的/srv/ftp/upload中。
2.安装
解压tar包:
# cd /srv/ftp/upload
# tar -xf MySQL-5.5.20-1.sles11.x86_64.tar解出了6个rpm文件:
MySQL-client-5.5.20-1.sles11.x86_64.rpm
MySQL-devel-5.5.20-1.sles11.x86_64.rpm MySQL-embedded-5.5.20-1.sles11.x86_64.rpm MySQL-server-5.5.20-1.sles11.x86_64.rpm MySQL-shared-5.5.20-1.sles11.x86_64.rpm MySQL-test-5.5.20-1.sles11.x86_64.rpm把server和client装上:
# rpm -ivh MySQL-server-5.5.20-1.sles11.x86_64.rpm
# rpm -ivh MySQL-client-5.5.20-1.sles11.x86_64.rpm这时直接输入mysql命令会提示ERROR 2002 (HY000):Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
是因为mysql服务未启动,要执行:
# /etc/init.d/mysql start
来启动mysql。