I am on Ubuntu 20.04, trying to migrate from MySQL to MariaDB 10.5. I have mariadb installed correctly and I am trying to import the dump of all of my dbs in the new mariadb using mysql -u root -p < all_dbs.sql
, but just it outputs:
ERROR 1005 (HY000) at line 87: Can't create table
mysql.db
(errno: 168 "Unknown (generic) error from engine")`
I am fairly new to database administration and I would appreciate some detailed instructions on how to solve this problem.
My Steps
1.) First, I dumped all my dbs into a .sql file mysqldump -u root -p --all-databases > all_dbs.sql
2.) Then, I removed the mysql server from ubuntu sudo apt purge mysql-server
3.) From here, I installed mariadb:
sudo apt update && sudo apt upgrade
sudo apt -y install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.globo.tech/repo/10.5/ubuntu focal main'
sudo apt update
sudo apt install mariadb-server mariadb-client
# I foolishly answered "no", since it was telling me it was safe to do so...
4.) I tried import my dbdumpfile.sql using mysql -u root -p < all_dbs.sql
, but ran into this error 'ERROR 1698 (28000): Access denied for user 'root'@'localhost'
, so I used these instructions to solve that problem
5.) Which, of course, led to a new problem: Unknown collation: 'utf8mb4_0900_ai_ci' #1902
, which I solved with sed -i all_dbs.sql -e 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g'
6.)And -now- when I run mysql -u root -p < all_dbs.sql
, it outputs
ERROR 1005 (HY000) at line 87: Can't create table
mysql
.db
(errno: 168 "Unknown (generic) error from engine")
Any tips? Originally asked here (Did not Receive detailed answer..)