1

While trying to install MariaDB on Ubuntu 15.10, I issue command

$ sudo apt-get install mariadb-server

and it outputs

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libmysqlclient18 libterm-readkey-perl mariadb-client-10.0 
  mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 
  mariadb-server-core-10.0 mysql-common
Suggested packages:
  mailx mariadb-test tinyca
The following NEW packages will be installed:
  libdbd-mysql-perl libmysqlclient18 libterm-readkey-perl mariadb-client-10.0 
  mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 
  mariadb-server-core-10.0 mysql-common
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/11.6 MB of archives.
After this operation, 122 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

At the end the installation of packages are completed and the service mysql get installed. But, I never get a prompt/wizard for setting root credentials and other configuration. And later I'm not able to connect to the service

$ mysql -u -root -p
Enter password: 
ERROR 1698 (28000): Access denied for user '-root'@'localhost'

Not able to understand what is going wrong.

UPDATE What's more intriguing is the following

$ sudo mysqladmin -u root password <myPassword>
$ mysql -u root -p
Enter password: <myPassword>
ERROR 1698 (28000): Access denied for user 'root'@'localhost' 

I'm completely puzzled.

  • Was there any instance of MySQL/Mariadb/Percona installed? If it was removed with only apt-get remove (and not with apt-get purge), apt removes just a package, leaving everything (data and configuration files) else. Read more here. What repository are You using: Ubuntu or Maria (my guess is Ubuntu's default)? – Marcin S. Sep 6 '16 at 11:59
  • 1 Yes, I found out I had an old installation and as you said, I had purged it. 2 Yes, I am using Ubuntu's default repository. But shouldn't it be providing mariadb as per this – soufrk Sep 6 '16 at 15:48
  • And You've tried instaling it again after purging "leftovers"? With what result (same one)? – Marcin S. Sep 6 '16 at 22:30
  • Yes. Not only that I went ahead and deleted contents under /etc/mysql to ensure nothing stays. – soufrk Sep 7 '16 at 2:09
  • That will sound little windowish, but try purging everything related with MariaDB. Had similar issue when I've forgot my root password for some private testing instance. So try sudo apt-get purge mariadb* if possible. Then reinstall packages once again. – Marcin S. Sep 7 '16 at 6:21
0

It appears You had some MySQL/MariaDB/Percona instance previously installed, and some of data and config files were left in Your OS.

The way that worked for me on that case (Ubuntu Xenial 16.04 LTS with MariaDB 10.0 installed), with forgotten Maria's root password, was:

  • purging everything: sudo apt-get purge mariadb*
  • reboot; it didn't work without it, probably some related service running in background, locking some files from being purged: sudo reboot -h now
  • installing database once again: sudo apt-get install mariadb-server

Of course this was possible only on private dev machine, without any important data.

  • Yes, already. Even so the problem persists. – soufrk Sep 6 '16 at 11:18
  • Post updated, according to positive results of our chat. – Marcin S. Sep 7 '16 at 11:15
0

After lot of trial and error finally dropped installing on 15.10 and went ahead with 1604 instead,

  • FACT: I had mysql-server installed long earlier, which as per this, I'm guessing was ver 5.6

  • FACT: I had Wily 15.10 32 bit installed.

  • Now, as per this, MySQL-5.6 + MariaDB-5.5 backported = MariaDB-10.0 GA

    • Given that, MariaDB-5.5 = MySQL-5.5 + MariaDB-5.3
  • Package mariadb-server 10.0.25-0ubuntu0.15.10.1 (i386 binary) depends on mariadb-server-10.0 (>= 10.0.25-0ubuntu0.15.10.1) and is only available for 15.04 with amd64, which I don't understand what it's supposed to mean

  • CONCLUSION: Wily(15.04) started with MySQL 5.6, and right then MariaDB decided to fork and provide it's own distribution. Wily got upgraded to 15.10 but MariaDB hangs right in there in air.

  • ACTION: Installed MaraDB in Xenial(16.04) 64 bit, and it works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.