Chinaunix首页 | 论坛 | 博客
  • 博客访问: 232588
  • 博文数量: 52
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 731
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-25 17:46
文章分类
文章存档

2009年(13)

2008年(39)

我的朋友

分类: Mysql/postgreSQL

2009-03-28 13:27:09

对于Linux下安装MySQL我们推荐rpm安装。别的不说了,下面是本人的全过程;
首先一下:
 [root@localhost mysql]# rpm -qa  |grep mysql
mysql-libs-5.0.51a-1.fc9.i386
mysql-5.0.51a-1.fc9.i386
mysql-connector-odbc-3.51.24r1071-1.fc9.i386
mysql-server-5.0.51a-1.fc9.i386
php-mysql-5.2.5-7.fc9.i386
libdbi-dbd-mysql-0.8.3-1.fc9.i386
我们用rpm -e 卸载即可。如果有依赖兴可用rpm -e --nodeps即可。因为我是想换一下版本,。需把以前的卸载。注意备份自己的数据。至于如何备份以后本人推出的MySQL专辑汇详细介绍。好了,卸载之后就可以了。然后删除以前的my.cnf,其实不删也无妨。
 [root@localhost ~]# rm -f /etc/my.cnf
 [root@localhost ~]#  rm -rf /var/lib/mysql
这样以后就可以安装额。
先安装服务器软件包。如下:

[root@localhost ~]# rpm -ivh  MySQL-server-5.1.7-0.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

Support MySQL by buying support/licenses at
Starting MySQL[确定]

下面客户软件的安装,这是我们的客户端,比如mysql,mysqladmin等
[root@localhost ~]# rpm -ivh  MySQL-client-5.1.7-0.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]

下面是共享库的安装,
[root@localhost ~]# rpm -ivh  MySQL-shared-5.1.7-0.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-shared           ########################################### [100%]
然后

[root@localhost mysql]# cp my-medium.cnf  /etc/my.cnf

[root@localhost mysql]# /etc/init.d/mysql start
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.1.7-beta

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

mysql>

好,OK,

注意事项:前面的已安装库等要写全部卸载,不然你发现诸如mysqlmysql manager and pid-file was not found等错误。







阅读(4277) | 评论(0) | 转发(0) |
0

上一篇:javascript typeof 简介

下一篇:shell test 命令

给主人留下些什么吧!~~