您的位置:首页 > 运维架构 > Linux

install mysql and gcc in linux as 4.5 use INSTALL-BINARY version

2008-11-23 13:15 483 查看
1.机器
Ip地址 : 192.88.88.193
Raid设备 :Dell poweredge expandable raid controller 5i
硬盘 :2*400G SAS
内存: 8G
cpu :4*2G双核
操作系统:linux as 4.5

2.使用mysql INSTALL-BINARY 版本 mysql-5.0.67-linux-x86_64-icc-glibc23.tar.gz 进行安装,安装步骤

使用binary进行安装,文件名mysql-standard-5.0.18-linux-i686-glibc23.tar.gz
  1)将上述文件解压到某处,并将MySQL所以目录名改为mysql,结果应如/usr/local/mysql
  2)根据mysql目录下的INSTALL-BINARY文件来进行安装
  3) 加用户组mysql,以及用户mysql;该命令无需修改
  shell> groupadd mysql
  shell> useradd -g mysql mysql
  4)
  shell> cd /usr/local 
  shell> tar zxvf mysql-5.0.67-linux-x86_64-icc-glibc23.tar.gz
  shell> mv mysql-5.0.67-linux-x86_64-icc-glibc23 mysql 
  shell> cd mysql
  shell> scripts/mysql_install_db --user=mysql
  shell> chown -R root .
  shell> chown -R mysql data
  shell> chgrp -R mysql .
5)测试mysql
  shell> bin/mysqld_safe --user=mysql &
 
3.如果启动报错 libc.so.6.1(GLIBC_2.2)(64bit) is needed by Mysql,说明没有装gcc
4.安装gcc
rpm -Uvh glibc-kernheaders-...
rpm -Uvh glibc-headers-...
rpm -Uvh glibc-devel-...
rpm -Uvh cpp-...
rpm -Uvh gcc-c++...
运行gcc -v 仍然报错,显示需要libstdc++-devel-3.4.6-8.x86_64.rpm,gcc-3.4.6-8.x86_64.rpm
scp -P 22 libstdc++-devel-3.4.6-8.x86_64.rpm root@192.88.88.193:/root/tools
scp -P 22 gcc-3.4.6-8.x86_64.rpm root@192.88.88.193:/root/tools
并安装
到这个终于装上了gcc
[root@localhost mysql]# gcc -v
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)

5. 运行mysql
bin/mysql
bin/mysql: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
scp -P 22 libstdc++-3.4.6-8.x86_64.rpm root@192.88.88.193:/root/tools
scp -P 22 compat-libstdc++-33-3.2.3-47.3.x86_64.rpm root@192.88.88.193:/root/tools
并安装
6.运行mysql
报错
  Can't connect to local MySQL server through socket '/tem/mysql.sock'
7.
[root@localhost mysql]# /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql
Starting MySQL. [ 纭畾 ]
[root@localhost mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 1 to server version: 5.0.67

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

mysql>
到此安装成功!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: