my.cnf已經存在,影響安裝--mysql,my.cnf--mysql

來源:互聯網
上載者:User

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&......餘下全文>>
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.