redhat6 .4 安装mysql_RedHat4 上安装MySql5

1,上下载以下两个安装包:

MySQL-server-5.5.8-1.linux2.6.x86_64.rpm

MySQL-client-5.5.8-1.linux2.6.x86_64.rpm

2,安装server包:

# rpm -ivh MySQL-server-5.5.8-1.linux2.6.x86_64.rpm

warning: MySQL-server-5.5.8-1.linux2.6.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

error: Failed dependencies:

MySQL conflicts with mysql-4.1.20-1.RHEL4.1.i386

MySQL conflicts with mysql-4.1.20-2.RHEL4.1.0.1.x86_64

碰到这个错误,需要先把原来的mysql4安装包卸载掉:

# rpm -e mysql-4.1.20-1.RHEL4.1 –nodeps

# rpm -e mysql-4.1.20-2.RHEL4.1.0.1.x86_64 –nodeps

重新进行安装:

# rpm -ivh MySQL-server-5.5.8-1.linux2.6.x86_64.rpm

warning: MySQL-server-5.5.8-1.linux2.6.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

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 browsing04.china.nsn-net.net password 'new-password'

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

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

Notes regarding SELinux on this platform:

=========================================

The default policy might cause server startup to fail because it is

not allowed to access critical files. In this case, please update

your installation.

The default policy might also cause inavailability of SSL related

features because the server is not allowed to access /dev/random

and /dev/urandom. If this is a problem, please do the following:

1) install selinux-policy-targeted-sources from your OS vendor

2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:

allow mysqld_t random_device_t:chr_file read;

allow mysqld_t urandom_device_t:chr_file read;

3) cd to /etc/selinux/targeted/src/policy and issue the following command:

make load

3,安装Client包:

# rpm -ivh MySQL-client-5.5.8-1.linux2.6.x86_64.rpm

warning: MySQL-client-5.5.8-1.linux2.6.x86_64.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Preparing...########################################### [100%]

1:MySQL-client           ########################################### [100%]

4,启动MySql:

# service mysql start

Starting MySQL.........[ OK ]

5,修改Root密码:

# mysqladmin -u root password 'password'

6,修改Root配置,使Root可以远程登录进行管理:

# mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 27

Server version: 5.5.8 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "password" WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> quit

Bye

7,将MySql加入自启动:

# /sbin/chkconfig --list mysql

mysql0:off   1:off   2:on    3:on    4:on    5:on    6:off

# /sbin/chkconfig --del mysql

# /sbin/chkconfig --list mysql

service mysql supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add mysql')

# /sbin/chkconfig --add mysql

# /sbin/chkconfig --list mysql

mysql0:off   1:off   2:on    3:on    4:on    5:on    6:off

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值