Mariadb not working just after install on Ubuntu 16.04
If you check mysql --version
it should say something like:
mysql Ver 15.1 Distrib 10.1.16-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Then you know you're indeed running mariaDB then you can simply
sudo service mysql restart
and it should be all good!
Worth to lookup the file in /lib/systemd/system/mariadb.service
to see that it uses mysqld
.
MariaDB is running, it's just that it has disguised itself as MySQL (sneaky). MariaDB is a drop-in replacement for MySQL, so you start the MariaDB monitor using the CLI $ mysql
command, etc. All interactions where you specify MySQL directly in some way will actually affect MariaDB. (I don't know what happens if you are also running MySQL!) So to run MariaDB, the command is
$ service mysql start
Again, try this
$ service mysql status
to generate a whole lot of info, including something like this:
...
16 08:19:55 <YR-CMPTR> mysqld[1769]: Version: '10.0.28-MariaDB-0ubuntu0.16.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306
...
All apps that normally use MySQL won't even notice that they are interacting with MariaDB.
I believe the status thing is still using MySQL's name for the MariaDB package. Try
service mysql status
This should give you an "active (running)" status.
After migrating from MySQL to MariaDB, I had issues logging in as root from my (development) Chamilo portal (an e-learning platform) in PHP (so connecting through TCP/IP). I could, however, perfectly connect from the command line.
Checking mysql.user, I found that the "plugin" column said "unix_socket". This is all due to the new management of authentication through plugins since MySQL 5.5 and MariaDB 5.2.
I fixed it by re-granting all privileges to root without any plugin mention:
grant all privileges on *.* to root@'127.0.0.1' identified by 'mypass';
flush privileges;
This simply emptied the "plugin" column and I could connect through TCP/IP again.