mysql数据库,如何进行数据目录的初始化操作
需求描述:
当将mysql的二进制包解压之后,只有通过初始化数据库的数据目录,创建系统表之后才能使用mysql Server
数据库版本:5.5.57-log
操作过程:
1.通过解压之后的mysql包中scripts目录下的mysql_install_db脚本对DB进行初始化
[mysql@redhat6 mysql]$ scripts/mysql_install_db --user=mysql #通过--user=mysql来确定是使用哪个用户来初始化数据库,即通过哪个用户来运行数据库
Installing MySQL system tables... #安装Mysql的系统表
:: [Warning] option 'slow_query_log': boolean value '/mysql/data/log/slow-query.log' wasn't recognized. Set to OFF.
:: [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /mysql/mysql/bin/mysqld (mysqld 5.5.-log) starting as process ...
:: [Warning] You need to use --log-bin to make --binlog-format work.
OK
Filling help tables... #增加help表
:: [Warning] option 'slow_query_log': boolean value '/mysql/data/log/slow-query.log' wasn't recognized. Set to OFF.
:: [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /mysql/mysql/bin/mysqld (mysqld 5.5.-log) starting as process ...
:: [Warning] You need to use --log-bin to make --binlog-format work.
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: /mysql/mysql/bin/mysqladmin -u root password 'new-password' #为root用户设置密码
/mysql/mysql/bin/mysqladmin -u root -h redhat6 password 'new-password' Alternatively you can run:
/mysql/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 /mysql/mysql ; /mysql/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd /mysql/mysql/mysql-test ; perl mysql-test-run.pl Please report any problems at http://bugs.mysql.com/
备注:在我的这个环境中,已经配置了/etc/my.cnf,里面设置datadir选项指明了将data目录存放的位置.
小结:
mysql_install_db脚本的作用就是初始化数据库,创建系统表.
文档创建时间:2018年4月8日21:52:09
mysql数据库,如何进行数据目录的初始化操作的更多相关文章
- MySQL数据库(6)_用户操作与权限管理、视图、存储过程、触发器、基本函数
用户操作与权限管理 MySQL用户操作 创建用户 方法一: CREATE USER语句创建 CREATE USER "用户名"@"IP地址" IDENTIFIE ...
- Django中使用mysql数据库并使用原生sql语句操作
Django自身默认使用sqlite3这个轻量级的数据库,但是当我们开发网站时,sqlite3就没有mysql好,sqlite3适合一些手机上开发使用的数据库. 准备的软件mysql数据库,版本5.7 ...
- MySQL数据库(2)- 库的操作、表的操作、数据的操作、存储引擎的介绍
一.库的操作 1.系统数据库 执行如下命令,查看系统数据库: mysql> show databases; 参数解释: information_schema: 虚拟库,不占用磁盘空间,存储的是数 ...
- 【Python + Mysql】之用pymysql库连接Mysql数据库并进行增删改查操作
用pip下载pymysql并引用 具体请参考文章: <Python之MySQL数据库增删改查操作> <python3.6 使用 pymysql 连接 Mysql 数据库及 简单的增删 ...
- MySQL数据库(二)--库相关操作、表相关操作(1)、存储引擎、数据类型
一.库相关操作 1.创建数据库 (1)语法 create database 数据库 charset utf8; (2)数据库命名规范 可以由字母.数字.下划线.@.#.$ 区分大小写 唯一性 不能使用 ...
- MySQL数据库(二)——库相关操作、表相关操作(一)、存储引擎、数据类型
库相关操作.表相关操作(一).存储引擎.数据类型 一.库相关操作 1.创建数据库 (1)语法 create database 数据库 charset utf8; (2)数据库命名规范 可以由字母.数字 ...
- 48.Python中ORM模型实现mysql数据库基本的增删改查操作
首先需要配置settings.py文件中的DATABASES与数据库的连接信息, DATABASES = { 'default': { 'ENGINE': 'django.db.backends.my ...
- php之PDO连接mysql数据库,增删改查等等操作实例
我们使用传统的 mysql_connect .mysql_query方法来连接查询数据库时,如果过滤不严就有SQL注入风险,导致网站被攻击. 虽然可以用mysql_real_escape_string ...
- java连接mysql数据库 三 实现增删改查操作
同以前一样,先写一个数据库打开和关闭操作类 public class DBConnection { String driver = "com.mysql.jdbc.Driver"; ...
随机推荐
- Linux命令(27):shell 结合expect,多服务器批量分发数据
shell 结合expect 写的批量scp脚本工具 except安装:http://www.cnblogs.com/lovychen/p/6525623.html expect用于自动化地执行lin ...
- js 的登录验证
$scope.startLogin = function () { console.log('loginTimeHelper:startLogin: ' + getCurrentTime()); ef ...
- Linux shell 执行修改配置文件中的内容
在开发的过程中可能Linux环境不一致需要适应本地环境的HOME目录,可以通过脚本来修改配置文件内容,写一个test.sh的脚本 在脚本里写入以下命令 sed -i “s#ftfts_com_serv ...
- Python import random报错处理办法
[转自]http://blog.chinaunix.net/uid-26000296-id-4356738.html python安装失败:make的时候报错: /usr/include/tkDecl ...
- php写杨辉三角算法
<?phpfunction YangHui($iLine) { for ($i = 0;$i <= $iLine;$i++)//行 { for ($j ...
- Python的内存管理 小理解
请看下面的一段代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 origin = {'a':100,'b':[1,2,34,5]} obj_copy ={}; ...
- c++之——多态性
先看一个例子: #include<iostream> using namespace std; class Liberation { public: Liberation(int a):c ...
- 在腾讯开发 QQ IM 的工作体验是怎样的?
转载 http://blog.csdn.net/kobejayandy/article/details/8685271 目录 一.引言 二.个人网站 三.Oracle/支付宝/旺旺 四.淘宝技术发展( ...
- 自定义maven变量以及maven内置常量
本文转自:http://zheng12tian.iteye.com/blog/1770909 在创建Maven工程后,插件配置中通常会用到一些Maven变量,因此需要找个地方对这些变量进行统一定义,下 ...
- pku1204 Word Puzzles AC自动机 二维字符串矩阵8个方向找模式串的起点坐标以及方向 挺好的!
/** 题目:pku1204 Word Puzzles 链接:http://poj.org/problem?id=1204 题意:给定一个L C(C <= 1000, L <= 1000) ...