今天在配置mysql replication的时候,修改完my.cnf文件,然后重启mysql service ,当执行下列命名的时候报错:mysql> change master to master_host=‘127.0.0.1‘, master_user=‘usertest‘, master_pass word=‘usertest‘, master_log_file=‘mysql-bin-000002‘, master_log_pos=8; ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log check错误日...
ERROR 1794 (HY000): Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log. error log中有类似日志:2016-05-10 17:21:25 14407 [Warning] InnoDB: Cannot open table mysql/innodb_table_stats from the internal data dictionary of InnoDB though the .frm file for the ...
搜索了下,网上给出的解决办法基本都是:
①、执行 reset slave;
②、重新执行 change master:
1
2
3
4
5
6
7
mysql> change master to
-> master_host=‘192.168.1.100‘,
-> master_port=3306,
-> master_user=‘repl‘,
-> master_password=‘repl‘,
-> master_log_file=‘mysql-bin.000051‘,
-> master_log_pos=254105;③、执行 start slave
于是试了下,发现还是一样的报错,顺着报错信息,看...
卸载mysql-python,改为安装 mysqlclient 最新版, windows下安装则 http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient 下载,然后就支持了
参考资料:
1、http://blog.csdn.net/wzqnls/article/details/53412635Django (2019, “Can’t initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)”) 错误解决方案标签:article 参考资料 cte pat 最新版 解决 bsp art can 本文系统来...
初始化msyql时出现报错
C:\mysql-5.7.19-winx64> C:\mysql-5.7.19-winx64\bin\mysqld --initialize-insecure2019-12-25T01:59:21.234788Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2019-12-25T01:59:21.237781Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting....
mysql> reset slave;
Query OK, 0 rows affected (0.01 sec)mysql> change master to -> master_host=‘10.0.0.101‘,-> master_port=3306,-> master_user=‘repl‘,-> master_password=‘repl‘,-> master_log_file=‘mysql-bin.000011‘,-> master_log_pos=1;
ERROR 29 (HY000): File ‘/data/mysqldata/3306/binlog/mysql-relay-bin.000001‘ not found (Errcode: 2)
看来应该还是mysql-relay-bin.index的问题,删除该文件及关...
start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
mysql> reset slave;
Query OK, 0 rows affected (0.04 sec)mysql> start slave IO_THREAD;
Query OK, 0 rows affected (0.07 sec)mysql> stop slave IO_THREAD;
Query OK, 0 rows affected (0.01 sec)mysql> reset slave;
Query OK, 0 rows affected (0.10 sec)mysql> start slave;
Query OK, 0 rows affected (0.20...
https://blog.csdn.net/tr1912/article/details/81271851
# mysqld --initialize --user=mysql[root@localhost cyx]# cp /etc/my.cnf /etc/my.cnf.bak[root@localhost cyx]# vim /etc/my.cnf[root@localhost cyx]# cd /var/lib/mysql /var/lib/mysql
# mv mysql mysql-bak-cyx[root@localhost lib]# mysqld --initialize --user=mysql[root@localhost lib]# systemctl status mysqld
症状:
MySQL主从复制,启动slave时,出现下面报错:mysql> start slave;ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
原因:可能为服务器启动后,太长时间连接不到master。
解决办法:查看日志,
可以看到报错,原来是找不到./server246-relay-bin.index文件,找到原因所在了,由于我使用的是冷备份文件恢复的实例,在mysql库中的slave_relay_log_info表中依然保留之前rela...
报错背景
mysql 想要重新格式化 mysqld --initialize,结果报错。
报错现象报错原因
initialize specified but the data directory has files in it. Aborting.
由这句话可知,data目录下有文件了,所以格式化失败。
报错解决
找到这个目录目录所在位置可以在mysql的配置文件中查询
# vim /etc/my.cnf
将此文件夹删除
# rm -rf /var/lib/mysql
重新格式化
# mysqld --initialize
我为我的项目编写了一个扩展ActiveRecord模型行为的方法,我已经删除了大部分内容,请考虑以下代码:class ActiveRecord::Basedef self.has_translationsafter_initialize :clear_translations_cachedef clear_translations_cachebinding.pry@_translations = {}endend
end基本上,我希望在我从数据库中重载实例时清除@_translations实例变量,但由于某种原因,在从数据库中获取现有对象后,执行填充@_translations的方法,然后执行object...
我正在使用Spring 3.1.1.RELEASE,JUnit 4.8.1和MySQL 5.5.我希望在每次测试之前截断所有表数据,但是在Spring中遇到错误,即使我可以通过命令行执行以下脚本(truncate_tables.sql)…drop procedure if exists truncate_tables;delimiter #
create procedure truncate_tables()
begindeclare tab_name varchar(64);declare done tinyint unsigned default 0;declare table_cur cursor for select t.table_namefrominformation_schema....
解决:
需要使用mysqld来初始化
./mysqld --initialize --datadir=/usr/local/mysql-cluster/data --user=mysql --basedir=/usr/local/mysql-cluster
在安装mysql时遇到以下错误
执行./mysqld --initialize 后
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
原因是没有安装libaio.so.1,安装即可。
Ubuntu下执行:
apt-get install libaio1 l...
ERROR 1794 (HY000): Slave?is not configured or failed to initialize properly. You must at least?set --server-id to enable either a master or a slave. Additional error messages can be found?in the MySQL error log.
?error?log中有类似日志:2016-05-10 17:21:25?14407?[Warning]?InnoDB:?Cannot?open?table?mysql/innodb_table_stats?from?the?internal?data?dictionary?of?InnoDB?though?the?.frm?file?for?the...