mysql错误【一】[ERROR] Missing system table mysql.proxies_priv

环境:mysql一主一从架构,主库是mysql5.1,从库是mysql5.6;系统均为CentOS6.2

问题:

在主库上面执行的SQL语句

1.创建表

CREATE TABLE `app_versions` (
  `date` date NOT NULL,
  `app` char(16) NOT NULL,
  `ver` char(16) NOT NULL,
  `val` int(11) DEFAULT ‘0‘,
  PRIMARY KEY (`date`,`app`,`ver`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

2.创建用户并且给予权限

grant select on databasename.* to ‘username‘@‘IPaddress‘ identified by ‘password‘

3.刷新权限信息

flush privileges

在主库上面执行完之后,在从库上面执行show slave status \G发现IO进程和SQL进程显示的都是NO,然后执行start slave IO_THREAD之后再次执行show slave status \G 发现IO进程是拉起来了的显示的是YES,之后再执行start slave SQL_THREAD进程,show slave status \G发现IO进程和SQL进程都是显示的NO,并且在从库的错误日志中可以获取得到:

在错误日志中可以很明显的看得到日志提示:

Missing system table mysql.proxies_pri;please run mysql_upgrade to create it

日志提示系统表mysql.proxies_pri不存在,需要执行mysql_upgrade,然后我自己google了一下,

发现大部分都是因为升级mysql之后没有执行mysql_upgrade导致的,但是我在主库上面根本就没有进

行任何的升级操作,在从库也是这个样子,然后网上的建议是mysql_upgrade升级修复一下。

mysql_upgrade主要作用是检测所有的表并且升级mysql这个系统库内所有的表,是进行在线升级的,所以并不会影响线上操作(PS:当然不包括有关mysql库的操作)。

The mysql.proxies_priv table contains information about proxy privileges. The table can be queried and although it is possible to directly update it, it is best to use GRANT for setting privileges.

可以看到上述对于mysql.proxies_priv系统表的猜测,可以比较明显的看到这个表主要是用来管理

数据库用户权限信息的表,所以我猜测数据库很有可能卡在权限这块了,并且在从库中我在mysql.user这个表中并没有发现我之前grant创建的用户。这个时候我在从库上面设置了跳过一个事务:

set global sql_slave_skip_counter = 1(只是跳过一个事务,跳过之后归0)

之后我在重启start slave。slave恢复了正常,日志也能够正常的往里面写了。所以我猜想这个问题和

权限有关,假如需要验证的话,最好是在从库上面开启general log,并且在从库的binlog获取最新的事

务的信息并且根据获取的信息在relay log中继日志找到下一个事务是不是这个。

但是这个方案也是属于治标不治本,下次在执行grant操作的时候,可能还是会出现这个问题,所以还是最后使用mysql_upgrade

mysql_upgrade -uroot -p

[[email protected] data]# mysql_upgrade -uroot -p

Enter password:

Looking for ‘mysql‘ as: mysql

Looking for ‘mysqlcheck‘ as: mysqlcheck

This installation of MySQL is already upgraded to 5.6.35, use --force if you still need to run mysql_upgrade

[[email protected] data]# mysql_upgrade -uroot -p --force

Enter password:

Looking for ‘mysql‘ as: mysql

Looking for ‘mysqlcheck‘ as: mysqlcheck

Running ‘mysqlcheck‘ with connection arguments: ‘--port=3306‘ ‘--socket=/data/mysql/mysql.sock‘

Warning: Using a password on the command line interface can be insecure.

Running ‘mysqlcheck‘ with connection arguments: ‘--port=3306‘ ‘--socket=/data/mysql/mysql.sock‘

Warning: Using a password on the command line interface can be insecure.

mysql.columns_priv                                 OK

mysql.db                                           OK

mysql.event                                        OK

mysql.func                                         OK

mysql.general_log                                  OK

mysql.help_category                                OK

mysql.help_keyword                                 OK

mysql.help_relation                                OK

mysql.help_topic                                   OK

mysql.innodb_index_stats                           OK

mysql.innodb_table_stats                           OK

mysql.ndb_binlog_index                             OK

mysql.plugin                                       OK

mysql.proc                                         OK

mysql.procs_priv                                   OK

mysql.proxies_priv_bak                             OK

mysql.servers                                      OK

mysql.slave_master_info                            OK

mysql.slave_relay_log_info                         OK

mysql.slave_worker_info                            OK

mysql.slow_log                                     OK

mysql.tables_priv                                  OK

mysql.time_zone                                    OK

mysql.time_zone_leap_second                        OK

mysql.time_zone_name                               OK

mysql.time_zone_transition                         OK

mysql.time_zone_transition_type                    OK

mysql.user                                         OK

Running ‘mysql_fix_privilege_tables‘...

Warning: Using a password on the command line interface can be insecure.

Running ‘mysqlcheck‘ with connection arguments: ‘--port=3306‘ ‘--socket=/data/mysql/mysql.sock‘

Warning: Using a password on the command line interface can be insecure.

Running ‘mysqlcheck‘ with connection arguments: ‘--port=3306‘ ‘--socket=/data/mysql/mysql.sock‘

Warning: Using a password on the command line interface can be insecure.

core_test.test                                     OK

data_test.test                                     OK

gitlabhq_production.abuse_reports                  OK

gitlabhq_production.application_settings           OK

gitlabhq_production.audit_events                   OK

gitlabhq_production.broadcast_messages             OK

gitlabhq_production.deploy_keys_projects           OK

gitlabhq_production.emails                         OK

gitlabhq_production.events                         OK

gitlabhq_production.forked_project_links           OK

gitlabhq_production.identities                     OK

gitlabhq_production.issues                         OK

gitlabhq_production.keys                           OK

gitlabhq_production.label_links                    OK

gitlabhq_production.labels                         OK

gitlabhq_production.members                        OK

gitlabhq_production.merge_request_diffs            OK

gitlabhq_production.merge_requests                 OK

gitlabhq_production.milestones                     OK

gitlabhq_production.namespaces                     OK

gitlabhq_production.notes                          OK

gitlabhq_production.oauth_access_grants            OK

gitlabhq_production.oauth_access_tokens            OK

gitlabhq_production.oauth_applications             OK

gitlabhq_production.project_import_data            OK

gitlabhq_production.projects                       OK

gitlabhq_production.protected_branches             OK

gitlabhq_production.schema_migrations              OK

gitlabhq_production.services                       OK

gitlabhq_production.snippets                       OK

gitlabhq_production.subscriptions                  OK

gitlabhq_production.taggings                       OK

gitlabhq_production.tags                           OK

gitlabhq_production.users                          OK

gitlabhq_production.users_star_projects            OK

gitlabhq_production.web_hooks                      OK

OK

时间: 2024-07-30 20:23:53

mysql错误【一】[ERROR] Missing system table mysql.proxies_priv的相关文章

Mysql错误问题:ERROR 1005 (HY000): Can't create table 'crm_1.tbl_client' (errno: 150)

MySQL外键创建条件: 1.两个表必须是InnoDB数据引擎2.外键表的外键字段必须是主键3.字段类型必须一致 创建表时创建外键: create table tbl_client(userName varchar(255) not null, address varchar(255), createDate timestamp not null default now(), createUserName varchar(255), foreign key(createUserName) ref

mysql错误:Error Code: 1175. You are using safe update mode and you tried to update a table……

今天遇到一个mysql错误: Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect. 网上查了一下,原来是SET SQL_SAFE_UPDATES

MySQL错误:ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

MySQL错误:ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES在执行MySQL复制的前奏时:为主服务器创建用户以便从服务器连接,出现该错误:GRANT REPLICATION SLAVE ON a_database.* to 'repl'@'domain.test' IDENTIFIED BY 'slavepass';之所以指定数据库我是希望能只复制这个数据库而忽略其他(已创建的或今后会创建的)数据库.因

在Ubuntu中使用MySQL错误:ERROR 1524 (HY000): Plugin 'msyql_native_password' is not loaded

报错信息提示: 解决方式: vi /etc/mysql/my.cnf 添加如下代码 [mysqld]skip-grant-tables 重启服务 sudo service mysql restart 登录mysql服务 成功解决,记录一下 在Ubuntu中使用MySQL错误:ERROR 1524 (HY000): Plugin 'msyql_native_password' is not loaded 原文地址:https://www.cnblogs.com/bai-boy/p/12272699

'mysql.column_stats' doesn't exist and Table 'mysql.index_stats' doesn't exist

在生产库MariabDB中修改字段类型,提示如下错误:?Table 'mysql.column_stats' doesn't existTable 'mysql.index_stats' doesn't exist ?MariaDB版本如下:??MariaDB [mysql]> select @@version;+---------------------+| @@version |+---------------------+| 10.0.12-MariaDB-log |+----------

MYSQL错误Can't connect to local MySQL server through socket '/var/lib/mysql/mysq

1.创建/修改文件 /etc/my.cnf,至少增加/修改一行 [mysql] [client] socket = /tmp/mysql.sock #在这里写上你的mysql.sock的正确位置,通常不是在 /tmp/ 下就是在 /var/lib/mysql/ 下2.指定IP地址,使用tcp方式连接mysql,而不使用本地sock方式 #mysql -h127.0.0.1 -uuser -ppassword 3.为 mysql.sock 加个连接,比如说实际的mysql.sock在 /tmp/

mysql错误:ERROR 1175: You are using safe update mode 解决方法

操作mysql数据库,删除表中的某一行数据提示如下错误:ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column 错误提示:正在使用安全更新模式,尝试更新表没有使用键列的where条件: 原因是:mysql有个叫SQL_SAFE_UPDATES的变量,为了数据库更新操作的安全性,此值默认为1,所以才会出现更新失败

MySQL 错误日志(Error Log)

同大多数关系型数据库一样,日志文件是MySQL数据库的重要组成部分.MySQL有几种不同的日志文件,通常包括错误日志文件,二进制日志,通用日志,慢查询日志,等等.这些日志可以帮助我们定义mysqld内部发生的事情,数据库性能故障,记录数据的变更历史,用户恢复数据库等等.本文主要描述错误日志文件. 1.MySQL日志文件系统的组成   a.错误日志:记录启动.运行或停止mysqld时出现的问题.   b.通用日志:记录建立的客户端连接和执行的语句.   c.更新日志:记录更改数据的语句.该日志在M

mysql错误:got error 28 from storage engine

今天碰到数据库出错 Got error 28 from storage engine 查了一下,数据库文件所在的盘应该没事,应该是数据库用的临时目录空间不够 引用 磁盘临时空间不够导致.解决办法:清空/tmp目录,或者修改my.cnf中的tmpdir参数,指向具有足够空间目录 上面的说法应该比较清楚,还有一个类似的: 引用 mysql报以下错的解决方法 ERROR 1030 (HY000): Got error 28 from storage engine 出现此问题的原因:临时空间不够,无法执