安装mysql数据库

安装mysql数据库

如果你下载的是源码,按如下方式安装

# pw groupadd mysql
# pw useradd mysql -g mysql -s /nonexitent
# tar -zxvf mysql-4.0.20.tar.gz
# mv mysql-4.0.20.tar.gz mysql
# cd mysql
# ./configure --prefix=/usr/local/mysql
# make
# make install
# scripts/mysql_install_db
# chown -R root /usr/local/mysql
# chown -R mysql /usr/local/mysql/var
# chgrp -R mysql /usr/local/mysql
# cp support-files/my-medium.cnf /etc/my.cnf
# /usr/local/mysql/bin/safe_mysqld --user=mysql &
# echo "/usr/local/mysql/bin/safe_mysqld --user=mysql &" > /etc/rc.local
# ./mysqladmin -u root -p password "your-password"

 


已编译包安装方法如下:
shell> pw groupadd mysql
shell> pw useradd mysql -g mysql -s /nonexitent
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root /usr/local/mysql
shell> chown -R mysql /usr/local/mysql/data
shell> chgrp -R mysql /usr/local/mysql
shell> chown -R root /usr/local/mysql/bin
shell> bin/safe_mysqld --user=mysql &
# echo "/usr/local/mysql/bin/safe_mysqld --user=mysql &" >> /etc/rc.local

还是注意Mysql的权限比较好

如果mysqld不能执行的话
# chmod 755 /usr/local/mysql/libexec/mysqld

basedir:     /usr/local/
datadir:     /var/db/mysql/
tmpdir:      /var/tmp/
language:    /usr/local/share/mysql/english/
pid file:    /var/db/mysql/route.pid
TCP port:    3306
Unix socket: /tmp/mysql.sock

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值