redhat linux mysql安装_Redhat Linux下MySql数据库的安装配置及简单操作

RPM安装Mysql

mysql需要perl(DBI)和perl-DBD-MySQL的支持,因此先安装perl-DBI及perl-DBD-MySQL

perl-DBI安装

[root@linux-a ~]# rpm -ivh /media/Server/perl-DBI-1.52-1.fc6.i386.rpm

warning: /media/Server/perl-DBI-1.52-1.fc6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

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

1:perl-DBI ########################################### [100%]

[root@linux-a ~]#

perl-DBD-MySQL安装

[root@linux-a ~]# rpm -ivh /media/Server/perl-DBD-MySQL-3.0007-1.fc6.i386.rpm

warning: /media/Server/perl-DBD-MySQL-3.0007-1.fc6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

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

1:perl-DBD-MySQL ########################################### [100%]

[root@linux-a ~]#

开始安装mysql

[root@linux-a ~]# rpm -ivh /media/Server/mysql-5.0.22-2.1.i386.rpm

warning: /media/Server/mysql-5.0.22-2.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

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

1:mysql ########################################### [100%]

[root@linux-a ~]#

安装mysql server

[root@linux-a ~]# rpm -ivh /media/Server/mysql-server-5.0.22-2.1.i386.rpm

warning: /media/Server/mysql-server-5.0.22-2.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

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

1:mysql-server ########################################### [100%]

[root@linux-a ~]#

初始化MySql数据库

[root@linux-a ~]# mysql_install_db

Installing all prepared tables

Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server

to the right place for your system

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 http://www.doczj.com/doc/2eeecd2c915f804d2b16c134.html password 'new-password'

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:

cd sql-bench ; perl run-all-tests

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

The latest information about MySQL is available on the web at

http://www.doczj.com/doc/2eeecd2c915f804d2b16c134.html

Support MySQL by buying support/licenses at http://www.doczj.com/doc/2eeecd2c915f804d2b16c134.html

[root@linux-a ~]#

修改mysql目录权限

安装好之后mysql目录权限如下

[root@linux-a ~]# ls -l /var/lib/mysql/

总计 8

drwx------ 2 root root 4096 08-16 16:55 mysql

drwx------ 2 root root 4096 08-16 16:55 test

将mysql目录所有者及用户组修改为mysql

[root@linux-a ~]# chown -R mysql /var/lib/mysql/

[root@linux-a ~]# chgrp -R mysql /var/lib/mysql/

启动mysql服务

[root@li

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值