---
title: "rh AS4 mysql install"
author: "douglas_lhs"
date: "2009-02-03T12:03:29Z"
tags: ["MySQL", "脚本"]
slug: "rh-as4-mysql-install"
draft: false
lastmod: "2009-02-03T12:03:29Z"
id: 322303
url: "https://douglas-lhs.iteye.com/blog/322303"
---

chown -R mysql:mysql /usr/local/mysql/
./scripts/mysql_install_db --user=mysql



自动运行MySQL

在MySQL二进制包里面，有一个叫myslq.server的启动脚本程序。把它复制到/etc/rc.d/init.d目录里面

：

# cd /etc/rc.d/init.d
# cp /usr/local/mysql/support-files/mysql.server mysql

接着把它的属性改为“x”（executable，可执行）

# chmod +x mysql

最后，运行chkconfig把MySQL添加到你系统的启动服务组里面去。

# /sbin/chkconfig --del mysql
# /sbin/chkconfig --add mysql

# /etc/rc.d/init.d/mysql start

./bin/mysqladmin -u root password '123456'