MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1984|回复: 1

多实例数据库初始化的问题

[复制链接]
发表于 2016-3-29 10:30:56 | 显示全部楼层 |阅读模式
数据库安装完成后 建立了软连接
ln -s /application/mysql-5.5.32/ /application/mysql

在/etc/profile文件中加入了环境变量
export PATH=/application/mysql/binPATH

然后 目录和配置文件都建立好了
[root@localhost tools]# tree /data/
/data/
├── 3306
│   ├── data
│   ├── my.cnf
│   └── mysql
└── 3307
    ├── data
    ├── my.cnf
    └── mysql


进入cd /application/mysql/scripts/ 中进行数据库初始化./mysql_install_db –basedir=/application/mysql –datadir=/data/3306/data –user=mysql

./mysql_install_db –basedir=/application/mysql –datadir=/data/3306/data –user=mysql

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.

就提示这个 后查看mysql 和mysql-5.5.32 目录文件发现是一样的没有区别

然后用/application/mysql-5.5.32/scripts/mysql_install_db --basedir=/application/mysql-5.5.32 --datadir=/data/3306/data --user=mysql 初始化正常
[root@localhost mysql-5.5.32]# /application/mysql-5.5.32/scripts/mysql_install_db --basedir=/application/mysql-5.5.32 --datadir=/data/3306/data --user=mysql
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:

/application/mysql-5.5.32/bin/mysqladmin -u root password 'new-password'
/application/mysql-5.5.32/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/application/mysql-5.5.32/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /application/mysql-5.5.32 ; /application/mysql-5.5.32/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /application/mysql-5.5.32/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /application/mysql-5.5.32/scripts/mysqlbug script!


[root@localhost mysql-5.5.32]# tree /data/
/data/
├── 3306
│   ├── data
│   │   ├── mysql
│   │   │   ├── columns_priv.frm
│   │   │   ├── columns_priv.MYD
│   │   │   ├── columns_priv.MYI
│   │   │   ├── db.frm
│   │   │   ├── db.MYD
│   │   │   ├── db.MYI
│   │   │   ├── event.frm
│   │   │   ├── event.MYD
│   │   │   ├── event.MYI
│   │   │   ├── func.frm
│   │   │   ├── func.MYD
│   │   │   ├── func.MYI
│   │   │   ├── general_log.CSM
│   │   │   ├── general_log.CSV
│   │   │   ├── general_log.frm
│   │   │   ├── help_category.frm
│   │   │   ├── help_category.MYD
│   │   │   ├── help_category.MYI
│   │   │   ├── help_keyword.frm
│   │   │   ├── help_keyword.MYD


没搞懂这是为什么

发表于 2016-4-12 13:45:12 | 显示全部楼层
./mysql_install_db –basedir=/application/mysql –datadir=/data/3306/data –user=mysql
初始化使用 --basedir吧。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-3-28 18:38 , Processed in 0.069081 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表