[MDEV-14416] Installing mariadb 10.2 in a fresh system shows error Created: 2017-11-16  Updated: 2017-11-16  Resolved: 2017-11-16

Status: Closed
Project: MariaDB Server
Component/s: Platform Debian
Affects Version/s: 10.2.10
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: gowtham Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: Compatibility
Environment:

debian 8 , VPS , 8 GB ram


Issue Links:
Duplicate
duplicates MDEV-14244 MariaDB 10.2.10 fails to run on Debia... Closed

 Description   

I followed this link for installing mariadb-server 10.2 .
*https://downloads.mariadb.org/mariadb/repositories/#mirror=23Media&distro=Debian&distro_release=jessie--jessie&version=10.2*

i have added repo.list and keys.But ended up with the following error message

  • Unable to set password for the MariaDB "root" user. An error occurred while setting the password for the MariaDB administrative user. This may have happened because the account already has a password, or because of a communication problem with the MariaDB server.You should check the account's password after the package installation*

But mariadb-server 10.0, 10.1 are installing and working fine .



 Comments   
Comment by Elena Stepanova [ 2017-11-16 ]

Did you have on this machine 10.1 MariaDB server installed from the Debian default repo before switching to 10.2?

Comment by gowtham [ 2017-11-16 ]

no , it was fresh VPS . if i remove my old my.cnf file and install 10,2 it is installing . but without my.cnf how can i add replication and all other things?

Comment by Elena Stepanova [ 2017-11-16 ]

If there was no MariaDB / MySQL before, how come you have an old my.cnf file?
And could you please attach this file that causes the trouble?

Comment by gowtham [ 2017-11-16 ]

when i end up with this error , i uninstalled mariadb-server .but my.cnf was there inside /etc/mysql/. so i removed my.cnf . and re installed mariadb . it worked . It didnt create my.cnf automatically .

Comment by gowtham [ 2017-11-16 ]

is there anything i should do ? please suggest me .Even i tried with reloading os in VPS . fresh debian installation . Again i tried fresh installation of mariadb -server . it shows unable to set root password.

Comment by Elena Stepanova [ 2017-11-16 ]

I asked you if you had a 10.1 server, you said that no, you had a clean VPS. Now you are saying that you did have some mariadb-server which you uninstalled.
Please figure out which it is before trying things. If you had a mariadb/mysql server, even if you removed it, it's not a clean installation, unless you carefully purged all data, which you apparently didn't, since you still had at least a config to remove. If you have old data, authentication rules recorded there apply, and the result depends on what was there, which depends on what server was installed before.

If you want something resembling a clean installation,
1) run dpkg -l | grep -iE 'mysql|maria|galera|percona' and make sure there are no traces of MySQL, MariaDB or Percona server or client;
2) remove (recursively) all of /etc/mysql*, /var/lib/mysql, /var/log/mysql.

Then try to install.

Comment by gowtham [ 2017-11-16 ]

Results are :
root@s:/# dpkg -l | grep -iE 'mysql|galera|maria|percona'
root@s:/# apt-get install mariadb-server
......
a window appeared for password , i typed 12345
again it said unable to set password for 'root' user
..........
[ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-11-16 8:16:38 139802988214144 [Note] InnoDB: Starting shutdown...
2017-11-16 8:16:38 139802988214144 [ERROR] Plugin 'InnoDB' init function returned error.
2017-11-16 8:16:38 139802988214144 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-11-16 8:16:38 139802988214144 [Note] Plugin 'FEEDBACK' is disabled.
ERROR: 1146 Table 'mysql.user' doesn't exist
2017-11-16 8:16:38 139802988214144 [ERROR] Aborting

Comment by Elena Stepanova [ 2017-11-16 ]

Okay, I see.
After you got this error, without further uninstalling or removing anything, please find the option innodb_flush_method = O_DIRECT in your config files and comment it.
Then run sudo mysql_install_db.
And then try to start the server the way you would normally start it.

Comment by gowtham [ 2017-11-16 ]

i commented out
innodb_flush_method = O_DIRECT inside my.cnf
root@s6:/etc/mysql# mysql_install_db

WARNING: The host 's6' could not be looked up with /usr/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
2017-11-16 8:52:50 140192713385856 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2017-11-16 8:52:50 140192713385856 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-11-16 8:52:51 140192713385856 [ERROR] Plugin 'InnoDB' init function returned error.
2017-11-16 8:52:51 140192713385856 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-11-16 8:52:51 140192713385856 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-11-16 8:52:51 140192713385856 [ERROR] Aborting

Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information.

Comment by Elena Stepanova [ 2017-11-16 ]

Okay, that's a bit confusing. Just in case the directory got damaged by the previous failed attempt, keep the option commented, and run

sudo rm -rf /var/lib/mysql/*
sudo mysql_install_db

If it doesn't work this way, then you probably have permission problems on /var/lib/mysql.

But if it helps and mysql_install_db works, please let us know what df -kT /var/lib/mysql say.

Comment by gowtham [ 2017-11-16 ]

root@s6:/rm -rf /var/lib/mysql/*
root@s6:/mysql_install_db
root@s6:/systemctl status mariadb.service
root@s6:/var/lib/mysql# systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Thu 2017-11-16 10:49:48 CST; 39s ago

yes that worked

root@s6:/var/lib/mysql# df -kT /var/lib/mysql
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/xvda2 ext3 102832424 1536596 96065492 2% /

Thank you

Comment by Elena Stepanova [ 2017-11-16 ]

Thanks. ext3 confirms that you've encountered the bug MDEV-14244 . It's already fixed, the fix will be released with the next release 10.2.11.

Generated at Thu Feb 08 08:13:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.