mysql启动时的初始执行文件的使用
来源:互联网 发布:excel自动填入数据 编辑:程序博客网 时间:2024/04/29 06:20
可以在配置文件里指定mysql启动以后初始执行的SQL文件, 其语法是:
在[mysqld]或者[server]下指定:
init-file=D:\mysql-5.5.28-winx64\abc.sql, 后边为具体的sql文件值
注意下边两点就行了:
1. 确保你的mysqld 编译的时候没有加 --disable-grant-options 开关。
2. 确保init-file指定的脚本每行是一个具体的可以执行的语句。
为了示例:
abc.sql为:
use test;begin;create table if not exists t123(id int);insert into t123 values(1);insert into t123 values(2);select * from t123;-- drop table t123;end;
启动完mysql以后,得到查询:
mysql> use test;Database changedmysql> select * from t123;+------+| id |+------+| 1 || 2 |+------+2 rows in set (0.00 sec)
第二次启动以后,得到结果:
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.5.28 MySQL Community Server (GPL)Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> use test;Database changedmysql> select * from t123;+------+| id |+------+| 1 || 2 || 1 || 2 |+------+4 rows in set (0.00 sec)
- mysql启动时的初始执行文件的使用
- mysql启动时的初始执行文件的使用
- VIM 启动文件的初始配置
- 使用C#执行MySQL的SQL文件
- 搞定使用MySQL导入外部的SQL文件执行
- 使用bat文件执行mysql的建库操作
- Java中初始块的执行顺序
- Java初始代码块的执行顺序
- Linux启动时~/.bash_profile等文件的执行过程
- R的启动顺序及执行文件
- Android程序启动初始画面的实现
- idea修改tomcat启动的初始页面
- for 语句的初始使用
- 执行Mysql脚本文件的方法
- 执行Mysql脚本文件的方法
- linux下执行mysql的sql文件
- 执行MySQL脚本文件遇到的问题
- linux下执行mysql的sql文件
- 用SqlDataReader返回多个结果集
- uva - 11137 - Ingenuous Cubrency
- spring 安全
- Tomcat6.0 配置外部数据源(JNDI)
- 用进废退 标致生活
- mysql启动时的初始执行文件的使用
- 多进程(1)
- DataTable读取表的架构信息
- oracle存储过程 基础
- 程序员面试题精选100题(27)-二元树的深度[数据结构]
- vi快捷键必知必会
- vwmare tools的安装
- 零基础学习COM之IUnknown抽象接口介绍
- 一些sqlserver时间的操作