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