mysql简明安装手册:
软件主页:
1.添加mysql 用户及组
groupadd mysql
useradd -g mysql -d /var/lib/mysql -s /sbin/nologin mysql
1.下载源码包
wget
2.解压源码包
tar zxvf mysql-4.1.7.tar.gz
3.配置编译参数
cd mysql-4.1.7
./configure \
--prefix=/usr \
--localstatedir=/var/lib/mysql \
--enable-local-infile \
--with-openssl \
--with-ndbcluster
4.编译并安装
make
make install
5.初始化数据库
./scripts/mysql_install_db
6.拷贝配置文件到/etc 目录
cp ./support-files/my-small.cnf /etc/my.cnf
7.拷贝自动启动脚本到系统初始化脚本目录并赋予执行权限
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
8.添加mysql 为系统服务
chkconfig --add mysqld
9.更改/var/lib/mysql 及其子目录的属主
chown -R mysql.mysql /var/lib/mysql
10.在/usr/lib 目录建立mysql 共享库的链接
ln -s /usr/lib/mysql/libmysqlclient.so.14.0.0 /usr/lib/libmysqlclient.so
ln -s /usr/lib/mysql/libmysqlclient.so.14.0.0 /usr/lib/libmysqlclient.so.14
ln -s /usr/lib/mysql/libndbclient.so.0.0.0 /usr/lib/libndbclient.so
ln -s /usr/lib/mysql/libndbclient.so.0.0.0 /usr/lib/libndbclient.so.0
11.启动mysql 服务
service mysqld start
12.运行mysql 客户端,为root 用户指定密码及访问许可
mysql -u root
mysql>set password for password');
mysql>use mysql;
mysql>delete from user where user='' ;
mysql>delete from user where host<>'localhost' ;
mysql>flush privileges ;
mysql>\q
阅读(1481) | 评论(0) | 转发(0) |