Upgrade fails with mysql.user wrong column count and expired password - mysql

I moved from mariadb to mysql (which worked). Now I wanted to upgrade mysql to 5.7 but it threw an error:
Running queries to upgrade MySQL server.
mysql_upgrade: (non fatal) [ERROR] 1728: Cannot load from mysql.proc. The table is probably corrupted
mysql_upgrade: (non fatal) [ERROR] 1545: Failed to open mysql.event
mysql_upgrade: [ERROR] 1072: Key column 'Id' doesn't exist in table
mysql_upgrade failed with exit status 5
I wanted to run mysqlcheck but it threw error:
Your password has expired. To log in you must change it using a client that supports expired passwords.
When I log in as root and want to SET PASSWORD I get this error
Column count of mysql.user is wrong. Expected 45, found 46.
When I want to start mysql with ignoring grant tables with
mysqld --skip-grant-tables
It fails silently.
What else can I try here? Reinstalling mysql results in the same
Key column 'Id' doesn't exist in table
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
error.

I added skip-grant-tables to my.cnf and issued:
ALTER TABLE mysql.user DROP COLUMN is_role;
that deleted the extra column.
Now I was able to update my passowrd again.
The remaining problem is the following. Apt is stuck on unconfigured packages. If apt wants to configure them it issues mysql_upgrade which will fail with "Key column 'Id' doesn't exist in table". It does not provide any other information. How can I debug this?
Then I used logging of mysql queries as #Piemol suggested to trace the last query.
The last query of msql_upgrade is:
ALTER TABLE slave_worker_info ADD Channel_name CHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The channel on which the slave is connected to a source. Used in Multisource Replication', DROP PRIMARY KEY, ADD PRIMARY KEY(Channel_name, Id)
Quit
slave_worker_info had no column ID, so I dropped the table (as it was empty) and created it again ( https://dba.stackexchange.com/questions/54608/innodb-error-table-mysql-innodb-table-stats-not-found-after-upgrade-to-mys )

Related

Mysql/mariadb "Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist"

Starting mariadb in arch linux results in "Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist" on systemctl logs
When installing the package, there's a notice that I didnt read about "You need to initialize the MariaDB data directory prior to starting
the service. This can be done with mariadb-install-db command, e.g.:
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
Just do that and you'll get it.

Magento 1.9 to 2 Migration : General error: 1419 You do not have the SUPER privilege and binary logging is enabled

I m migrating magento 1.9 to 2.x and when i try to migrate data using the migrate:data command it stops with the following error
[Zend_Db_Statement_Exception]
SQLSTATE[HY000]: General error: 1419 You do not have the SUPER
privilege and binary logging is enabled (you might want to use the
less safe log_bin _trust_function_creators variable), query was:
CREATE TRIGGER trg_catalog_compare_item_after_insert AFTER INSERT ON
catalog_compare_item FOR EACH ROW BEGIN
INSERT INTO m2_cl_catalog_compare_item (`catalog_compare_item_id`,
`operation`) VALUES (NEW.catalog_compare_item_id, 'INSERT')ON
DUPLICATE KEY UPDATE operation = 'INSERT';
END `
In my mysql server log_bin is set to off and i m using a super user. Can anyone help me to sort this out? Thanks!
To resolve this, the value of the log_bin_trust_function_creators parameter as 1.
For more information log_bin_trust_function_creators
one can execute below SQL:
mysql -u USERNAME -p
set global log_bin_trust_function_creators=1;
Possible reason: The latest gen of RDS MySQL has triggers disabled (while first gen apparently had it enabled default).

MySQL: [Err] 1146 - Unknown error 1146

I'm using MySQL 5.7.13. I'm getting above error if a table doesn't exist. Not only this whatever the error is I'm getting only 'unknown error'. Can any let me know that how to make MySQL to display actual error i.e. Table doesn't exist.
Thanks
Having the same issue with a raw download binary.
Comes with this error when trying to run any mysqld:
[ERROR] Can't find error-message file
Solved it by specifying --lc_messages_dir.
Examples:
mysqld --console --datadir ~/.mysqldata --lc_messages_dir=$MYSQL_HOME/share/english --initialize-insecure
mysqld --console --datadir ~/.mysqldata --lc_messages_dir=$MYSQL_HOME/share/english
1.You should probably look if your table exist.
2. If you are inserting data from one table to another table with a statement like, Insert into table_A select * from table_B, in this if there is any column mismatch, you will encounter this error.
Following two steps will help you out:
if you have copied the mysql data , Go to the original directory xampp/mysql/data ( or whatever is relevant to your OS) , and copy all the files starting with word ib, like ib_logfil0 etc. and paste to the new directory.
Go to mysql command line, and run this command:
mysql_upgrade

Database query failed. Error received from database was #144:

Database query failed. Error received from database was #144: Table 'dbname.mantis_bug_file_table' is marked as crashed and last (automatic?) repair failed for the query: SELECT bug_id, COUNT(bug_id) AS attachments
FROM mantis_bug_file_table
GROUP BY bug_id.
How to avoid above issue. Many times I got this error after repair table. If I repair table after loading the page it's says "#2013 - Lost connection to MySQL server during query".
Thanks.
Stop MySQL process first.Go to your data folder and try running myisamchk -r <table_name>. If it is not work then try with myisamchk -r -v -f <table_name>.

Installing MySQL system tables... ERROR: 1136 Column count doesn't match value count at row 1?

I was setting up a Rails 3 environment on my local machine with MySql5 following this tutorial: http://blog.openrain.com/2008/08/20/setup-ruby-and-rails-on-osx/.
When I run the below command:
sudo -u mysql mysql_install_db5
I get the following error.
--------
Installing MySQL system tables...
ERROR: 1136 Column count doesn't match value count at row 1
101010 22:40:53 [ERROR] Aborting
101010 22:40:53 [Note] /opt/local/libexec/mysqld: Shutdown complete
---------
Please help me resolve this.
Thanks
Vishal
It appears that there were lingering files and sql tables from my previous installation.
I emptied the following directory '/opt/local/var/db/mysql5' and then executed 'sudo -u mysql mysql_install_db5' successfully.