Slave failed to initialize relay log info structure from the repository
启动从时报错:mysql> start slave;ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryreset slave之后可以:mysql> reset slave;Query OK, 0 rows affected (0.00 sec)mysql> change master to master_host='192.168.118.161', master_user...
binlog_format=row显示语句
binlog_format=row的情况下: 对delete的内容,通过 mysqlbinlog找到 真实的delete语句, 也可以通过这种方法 ,构成一个insert语句,然后回滚这个操作 binlog_format=statement是不行的。 例: mysql> show variables like '%binlog_format%' -> ; +---------------+-------+ ...
mysql设置变量时何时可以使用表达示,何时可以使用M,G等单位
在操作符命令下不能使用 运算表达式,可以使用 M,G等单位。 在mysql命令行中,可以使用 运算表达式, 不可以使用M,G等单位。 例: 在OS命令下:[mysql@localhost mysql]$ mysql --max-allowed-packet=16M -u root -p123456 Warning: Using a password on the command line interface can be ins...
Mysql执行批量sql时的格式问题
Mysql执行批量sql时的格式问题:mysql执行批量sql时,输出格式想和在mysql提示符下一致的话,使用-t 选项-t, --table Output in table format.例:没有使用-t的样式:[mysql@localhost tmp]$ mysql -u root -p < /home/mysql/select_tt.txt | less Enter...
存储过程在主从库上的测试
存储过程在主从库上的测试:结论:从理论上来讲,从库可以不存在procedure, 主库上执行的procedure,会在binlog中转换为相应的sql语句,而不是调用procedure,所以从库上可以不存在这个procedure, 依然可以于主库数据同步。但是实际环境中,从库上还是要有这个procedure的, 毕竟主库down了之后,从转为主的话...
Error reading master configuration
Error reading master configuration设置主从同步时,出现下面的问题:MariaDB [(none)]> change master to master_host='192.168.118.159', master_user='song_rep', master_password='song_rep', master_port=3307, master_log_file='binlog.000005', master_log_pos=624;ERROR 1201 (HY000): Could not ...
binlog_cache_size 和 binlog_stmt_cache_size
binlog_cache_size 和 binlog_stmt_cache_sizebinlog_cache_size sets the size for the transaction cache only; the size of the statement cache isgoverned by the binlog_stmt_cache_size system variable.binlog_cache_size只是为事务缓存的大小而设置,binlog_stmt_cache_size管理语句缓存的...
set global long_query_time对当前窗口无效
直接修改global 的long_query_time 之后在当前的的窗口中是没有效果的,在新打开的窗口中才会有效果。如果想让本窗口也有效果 的话,不用加 global关键字。session 1 :mysql> show variables like 'long_query_time';+-----------------+----------+| Variable_name | Value &nbs...
eclipse中加入mysql源码
今天终于在linux+eclipse+mysql上,把mysql的源码加入到eclipse进去了。总结一下大概的步骤:1 mysql源码先安装好 cmake ./ make make install 2 把代码加入的eclipse里, build project--debug conf...
mysql源码安装时遇到的问题
源码安装的文档,可以搜到一大把,这里我只列出来 ,我遇到的问题:源码安装时遇到的错误:源代码安装时出现,启运数据库出现: 2015-03-20 09:19:56 17689 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 在my.cnf文件中 增加 basedir=/usr/local/mysql ...
mysql主外键依赖关系
查看主外键的依赖关系:在oracle中可以通过DBA_DEPENDENCIES查看得到。 在mysql中也可以查看通过查看 information_schema. key_column_usage MariaDB [test]> create table t1 ( id int primary key,name varchar(10));Query OK, 0 rows affected (0.36 sec)...
启动监听出错TNS-12547 TNS-12560 TNS-00517
许久不动的库,今天启动监听时出现问题:TNS-12547: TNS:lost contact TNS-12560: TNS:protocol adapter error TNS-00517: Lost contact Linux Error: 104: Connection reset by peer查看了一下文档:Starting TNS Listener or LSNRCTL Start Yields TNS-12541, Linux Error: 111: Connecti...
DROP TABLE ORA-01422
原来做过什么操作,不记得了。 现象是 删除表是 有下面的错误。SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biPL/SQL Release 10.2.0.4.0 - ProductionCORE &nbs...
ORA-1092
好久没有用的一个库,不记得做过什么操作了 启动时报错:SQL> startupORACLE instance started.Total System Global Area 536870912 bytesFixed Size 2085288 bytesVariable Size 150998616 ...
两列复合索引中(交换索引中列的顺序),选索引的原则是?因为索引名字ascii码小?
对于一个两列的复合索引,where条件中都是用 “=” 号 和 and, 选取索引时,为什么选择 索引名 ascii码小的??在天师 老托拉呱 的指点下, 不用动态采样+cbo, 还是一样的结果 。 用rbo的话,会一直有同一个。但是 不晓得 cbo的原因 。create table t11 as select * from dba_objects;...
默认dbms_scheduler job 选择在哪个节点执行
instance_stickinessThis attribute should only be used for a database running in RAC mode. By default, it is set to TRUE. If you set instance_stickiness to TRUE, jobs start running on the instance with the lightest load and the Scheduler thereafter attempts to run on the instance that it last ran on...
expdp会导出空表
在11g中,expdp会把空表也导出,虽然还没有分配segment exp是找不到没有分配segment的表SQL> conn song/song已连接。SQL> drop table test purge;表已删除。SQL> create table test (id number);表已创建。SQL> SELECT COUNT(*) FROM DBA_SEGMENT...
dba_objects 中不包含 constraint
dba_objects 中不包含 constraint, 其基表 obj$中也不包含 constraint;constraint (约束)的基表是 con$.SQL> conn song/songConnected.SQL> drop table t purge;Table dropped.SQL> create table t (id number);Table created.SQL> alter table t add primary key (id);Table altered.SQL...
索引和主键
索引和主键:对于非分区索引, 1 单列索引时,可以直接在索引列上强制主键而不会建立索引 2 组合索引时,可以在前缀列上直接加强制主键不会建立索引, 而对于非前缀列,会加额外的索引对于分区索引: 分区列必须是主键索引列的子集,才能使用已有索引。 如果不是的话,会新建索引SQL> conn song/...
通过db link访问分区表
通过 db_link 访问 分区表。在10g中,能过同义词,可以避免访问分区表分区 报错,但是得到的结果是错的。解决的方法 是: 在远端为 访问分区表的分区建立好视图SQL> conn song/song已连接。SQL> CREATE TABLE t_part 2 pARTITION BY RANGE (object_id) 3 &n...