加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 服务器 > 安全 > 正文

MySQL数据库多种安装方法及企业级安装实践(下篇)

发布时间:2021-01-11 22:51:35 所属栏目:安全 来源:网络整理
导读:副标题#e# 《MySQL数据库多种安装方法及企业级安装实践(下篇)》要点: 本文介绍了MySQL数据库多种安装方法及企业级安装实践(下篇),希望对您有用。如果有疑问,可以联系我们。 接《MySQL数据库多种安装方法及企业级安装实践(上篇)》 3.2.3初始化MySQL数据库
副标题[/!--empirenews.page--]

《MySQL数据库多种安装方法及企业级安装实践(下篇)》要点:
本文介绍了MySQL数据库多种安装方法及企业级安装实践(下篇),希望对您有用。如果有疑问,可以联系我们。

接《MySQL数据库多种安装方法及企业级安装实践(上篇)》

3.2.3初始化MySQL数据库文件

上述配置完毕后,就可以初始化数据库文件了,这个步骤其实也可以在编译安装MySQL之后就操作,只不过放到这里更合理一些.

(1)初始化MySQL数据库

初始化数据库的核心命令为:

application/mysql/scripts/mysql_install_db –basedir=/application/mysql/ –datadir=/application/mysql/data –user=mysql

提示:–basedir=/application/mysql/为MySQL的安装路径,–datadir为数据文件目录.另,注意mysql_install_db和MySQL5.1的路径不同,MySQL5.1不在MySQL bin路径下了.

整个初始化的操作过程为:

[root@oldboy mysql-5.6.34]# /application/mysql/scripts/mysql_install_db –basedir=/application/mysql/ –datadir=/application/mysql/data –user=mysql

#<==初始化mysql数据库文件,会有很多信息提示,如果没有ERROR级别的错误,有两个OK的字样,表示初始化成功,否则就要解决初始化的问题.

Installing MySQL system tables…2017-02-26 18:08:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).

2017-02-26 18:08:53 0 [Note] Ignoring –secure-file-priv value as server is running with –bootstrap.

2017-02-26 18:08:53 0 [Note] /application/mysql//bin/mysqld (mysqld 5.6.34) starting as process 47993 …

2017-02-26 18:08:53 47993 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-02-26 18:08:53 47993 [Note] InnoDB: The InnoDB memory heap is disabled

2017-02-26 18:08:53 47993 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-02-26 18:08:53 47993 [Note] InnoDB: Memory barrier is not used

2017-02-26 18:08:53 47993 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-02-26 18:08:53 47993 [Note] InnoDB: Using Linux native AIO

2017-02-26 18:08:53 47993 [Note] InnoDB: Using CPU crc32 instructions

2017-02-26 18:08:53 47993 [Note] InnoDB: Initializing buffer pool,size = 128.0M

2017-02-26 18:08:53 47993 [Note] InnoDB: Completed initialization of buffer pool

2017-02-26 18:08:53 47993 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2017-02-26 18:08:53 47993 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2017-02-26 18:08:53 47993 [Note] InnoDB: Database physically writes the file full: wait…

…省略若干…

2017-02-26 18:08:54 47993 [Note] InnoDB: Waiting for purge to start

2017-02-26 18:08:54 47993 [Note] InnoDB: 5.6.34 started; log sequence number 0

2017-02-26 18:08:54 47993 [Note] Binlog end

2017-02-26 18:08:54 47993 [Note] InnoDB: FTS optimize thread exiting.

2017-02-26 18:08:54 47993 [Note] InnoDB: Starting shutdown…

2017-02-26 18:08:55 47993 [Note] InnoDB: Shutdown completed; log sequence number 1625977

OK?

#<==两个OK是初始化成功的标志.

Filling help tables…2017-02-26 18:08:55 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).

2017-02-26 18:08:55 0 [Note] Ignoring –secure-file-priv value as server is running with –bootstrap.

2017-02-26 18:08:55 0 [Note] /application/mysql//bin/mysqld (mysqld 5.6.34) starting as process 48015 …

2017-02-26 18:08:55 48015 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-02-26 18:08:55 48015 [Note] InnoDB: The InnoDB memory heap is disabled

…省略若干…

2017-02-26 18:08:56 48015 [Note] InnoDB: FTS optimize thread exiting.

2017-02-26 18:08:56 48015 [Note] InnoDB: Starting shutdown…

2017-02-26 18:08:57 48015 [Note] InnoDB: Shutdown completed; log sequence number 1625987

OK?

#<==两个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//bin/mysqladmin -u root password ‘new-password’

/application/mysql//bin/mysqladmin -u root -h oldboy password ‘new-password’

Alternatively you can run:

/application/mysql//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//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

###请注意如下几行英文的说明

New default config file was created as /application/mysql//my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

#从上文说明中可以指导mysql的默认配置文件已经变到了/application/mysql//my.cnf

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this,either remove it,or use the

–defaults-file argument to mysqld_safe when starting the server

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读