欢迎投稿

今日深度:

my.cnf已经存在,影响安装--mysql,my.cnf--mysql

my.cnf已经存在,影响安装--mysql,my.cnf--mysql


Found existing config file ./my.cnf on the system.

Because this file might be in use, it was not replaced,

but was used in bootstrap (unless you used --defaults-file)

and when you later start the server.

The new default config file was created as ./my-new.cnf


以上提示是在运行了

scripts/mysql_install_db --user=mysql

之后提示的,这是因为我的/usr/local/mysql/下已经有了my.cnf,将其改名,再重试,就ok了


Mysql的配置文件/etc/mycnf 可不可以指定放到别的目录下

可以的。但是要设置mysql访问权限。
 

mysql创建多个实例,mycnf配置文件需要几个?

配置文件还是一个,只不过mysql的数据库存放目录需要多个,这根据你的实例来配置数据库存放目录。
给个多实例配置案例:
初始化数据库
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1001 #创建数据库存放目录
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1002
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1003
[mysql@localhost mysql_db]$ ./bin/mysql_install_db –basedir=/mydata/mysql_db –datadir=/mydata/mysql_db/data_1001 –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:

/mydata/mysql_db/bin/mysqladmin -u root password ‘new-password’
/mydata/mysql_db/bin/mysqladmin -u root -h localhost password ‘new-password’

Alternatively you can run:
/mydata/mysql_db/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 /mydata/mysql_db ; /mydata/mysql_db/bin/mysqld_safe &

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

Please report any problems with the /mydata/mysql_db&......余下全文>>
 

www.htsjk.Com true http://www.htsjk.com/shujukunews/2714.html NewsArticle my.cnf已经存在,影响安装--mysql,my.cnf--mysql Found existing config file ./my.cnf on the system. Because this file might be in use, it was not replaced, but was used in bootstrap (unless you used --defaults-file) and when you lat...
评论暂时关闭