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"; ...
随机推荐
- 57. 3Sum【medium】
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ...
- Can you share some Scala List class examples?
Scala List FAQ: Can you share some Scala List class examples? The Scala List class may be the most c ...
- 利用eclipse中的各种功能帮助你理解代码
@菜单栏下面,工具栏,有一对黄色的箭头按钮,一个指向左边,一个指向右边,快捷键是Alt+Left/Alt+Right 功能是跳转到你刚刚编辑过的地方 这里的Left/Right指的是左右方向键,可以方 ...
- Python深入学习之内存管理
语言的内存管理是语言设计的一个重要方面.它是决定语言性能的重要因素.无论是C语言的手工管理,还是Java的垃圾回收,都成为语言最重要的特征.这里以Python语言为例子,说明一门动态类型的.面向对象的 ...
- 屏幕亮度(XE10.1+WIN8.164)
相关资料: http://bbs.csdn.net/topics/390664310 实例代码: unit Unit1; interface uses Winapi.Windows, Winapi.M ...
- redis 最优雅的错误提示
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: DENIED Redis ...
- 【Unity/Kinect】获取预制的手势信息KinectInterop.HandState
Kinect使用了枚举KinectInterop.HandState来描述手势. 该手势指的是手掌的状态(张开/握拳),而不是说整个手臂的肢体动作(Gesture). 同样是需要嵌套在Kinect获取 ...
- 【WPF/C#】测试下载文件(图片)
需求:界面上有一个按钮,点击后联网下载一张PNG图片,保存到本地指定路径. 重要参考: http://stackoverflow.com/questions/24797485/how-to-downl ...
- [小技巧]diff的文件夹忽略使用方式
当我们比较两个文件夹时经常需要忽略.svn或者.git,那么如下 diff -r -x ".git" -x "*.ko" -x "*.o" ...
- Android——实现欢迎界面的自动跳转(转)
Android实现欢迎界面的自动跳转,就是打开某一个安卓手机应用,出现的欢迎界面停留几秒钟,自动进入应用程序的主界面.在网上看到很多种实现办法,但是感觉这种方法还是比较简单的. 在onCreate里设 ...