- 论坛徽章:
- 0
|
一 准备
软件准备:mysql-5.0.45.tar.gz
安装环境:Centos4.5
二 解压
#tar zxvf mysql-5.0.45.tar.gz
#mv mysql-5.0.45 /usr/local/src/
#cd /usr/local/src/mysql-5.0.45
三 编译安装
#./configure --prefix=/usr/local/mysql
#make && make install
四 配置
#cp support-files/my-large.cnf /etc/my.cnf
#mkdir /usr/local/mysql/var
#useradd -d /usr/local/mysql/var mysql
#su - mysql
$/usr/local/mysql/bin/mysql_install_db &
成功后系统返回信息如下:
Installing MySQL system tables...
OK
Filling help tables...
OK
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/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h centos.cn password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[1]+ Done /usr/local/mysql/bin/mysql_install_db
五 设置可执行路径
#vi /etc/profile
pathmunge /usr/bin 下添加
pathmunge /usr/local/mysql/bin
六 启动
#bin/mysql_safe --user=mysql &
七 测试
#mysql -u root
mysql> \s //查看系统信息
八 给root帐号添加密码:
#/usr/local/mysql/bin/mysqladmin -u root password '密码'
注:红色标识部分的第一个反斜杠是托意符
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/34252/showart_473801.html |
|