mysql install db作用_关于mysql_mysql_install_db

系统为Centos6.2 mysql-5.5.23

#bin/mysql_install_db  提示找不到目录和文件

不过经网友提醒,mysql_install_db 在mysql-5.5后改到/usr/local/mysql-5.5.23/scripts/mysql_install_db

在我执行又出现以下错误了

FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to

copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top

level of the extracted archive, or pass the --basedir option

pointing to that location.

groupadd mysql  #添加mysql组

useradd -g mysql mysql -s /bin/false  #创建用户mysql并加入到mysql组,不允许mysql用户直接登录系统 mkdir -p /data/mysql  #创建MySQL数据库存放目录 chown -R mysql:mysql /data/mysql   #设置MySQL数据库目录权限

cd /usr/local/mysql cp ./support-files/my-huge.cnf  /etc/my.cnf   #拷贝配置文件

vi /etc/my.cnf   #编辑配置文件,在 [mysqld] 部分增加 datadir = /data/mysql  #添加MySQL数据库路径 ./scripts/mysql_install_db --user=mysql  #生成mysql系统数据库

以这个方法把数据库初始化了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值