新随笔  :: 联系 :: 订阅 订阅  :: 管理

利用rpm安装mysql

Posted on 2011-10-07 21:57  张贺  阅读(459)  评论(0编辑  收藏  举报

yum install ncurses-libs.i686 libstdc++.i686 libgcc.i686

http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/libaio.so.1%28LIBAIO_0.1%29

需要libaio库

 

先查看系统中是否已经安装过MySQL:
rpm -qa|grep mysql  

MySQL-server-VERSION.rpm
mysql服务文件包(若连接远程服务器,可不用安装此包)
MySQL-client-VERSION.rpm
mysql客户端
一般只需要安装这2个文件包即可。

 查看安装包信息:

shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm

 安装一下2个文件包: 

shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm
shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm

To install only the client programs, install just the client RPM:

shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm
安装完成后需要重新启动计算机,之后输入mysql即可启动mysql
若提示"Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) "错误,则需要重新启动一下计算机
安装完成以后可以使用mysqladmin命令修改初始密码:



mysqladmin -u root password 'new-passwd'
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bogon password 'new-password'

目录结构:

/usr/bin Client programs and scripts
/usr/sbin The mysqld server
/var/lib/mysql Log files, databases
/usr/share/info Manual in Info format
/usr/share/man Unix manual pages
/usr/include/mysql Include (header) files
/usr/lib/mysql Libraries
/usr/share/mysql Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation
/usr/share/sql-bench

Benchmarks