Problem With Running MariaDB/MySQL For Use With Amarok

Hello!

I have a problem with starting MariaDB version 10.0.27 which came with the OpenSUSE 13.2 OS distribution. I am having an issue when I start the mysql.service, such as follows:

davids@DASmith-Thinkpad-01:~> sudo systemctl start mysql.service
root’s password:
Job for mysql.service failed. See “systemctl status mysql.service” and “journalctl -xn” for details.
davids@DASmith-Thinkpad-01:~> sudo systemctl stop mysql.service
davids@DASmith-Thinkpad-01:~> sudo systemctl enable mysql.service
davids@DASmith-Thinkpad-01:~> sudo systemctl start mysql.service
Job for mysql.service failed. See “systemctl status mysql.service” and “journalctl -xn” for details.
davids@DASmith-Thinkpad-01:~> sudo systemctl status -l mysql.service
mysql.service - MySQL server
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
Active: activating (start-post) (Result: exit-code) since Wed 2016-12-28 19:13:02 EST; 17s ago
Process: 30046 ExecStart=/usr/lib/mysql/mysql-systemd-helper start (code=exited, status=1/FAILURE)
Process: 30031 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
Process: 30017 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
Main PID: 30046 (code=exited, status=1/FAILURE); : 30047 (mysql-systemd-h)
CGroup: /system.slice/mysql.service
└─control
├─30047 /bin/bash /usr/lib/mysql/mysql-systemd-helper wait
└─30134 sleep 1

Dec 28 19:13:02 DASmith-Thinkpad-01.site systemd[1]: Starting MySQL server…
Dec 28 19:13:02 DASmith-Thinkpad-01.site mysql-systemd-helper[30047]: Waiting for MySQL to start
Dec 28 19:13:02 DASmith-Thinkpad-01.site mysql-systemd-helper[30046]: 161228 19:13:02 [Note] /usr/sbin/mysqld (mysqld 10.0.27-MariaDB) starting as process 30046 …
Dec 28 19:13:04 DASmith-Thinkpad-01.site systemd[1]: mysql.service: main process exited, code=exited, status=1/FAILURE
davids@DASmith-Thinkpad-01:~> mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysql/mysql.sock’ (2 “No such file or directory”)
davids@DASmith-Thinkpad-01:~>

I am trying to setup a local data base for Amarok. Do you have any idea what’s wrong? I am doing this on a Lenovo X201 ThinkPad laptop.

Thank you, :slight_smile:

David A. Smith

Hello!

Well, I think I have solved my start up problem with MariaDB myself by carefully editing the my.cnf file located in /etc and un-comment the following sections:

# The following options will be passed to all MariaDB clients
[client]
# password  = your_password
port       = 3306
socket     = /var/run/mysql/mysql.sock

and leave the following commented:

[mysqld]

# Remove leading # if you don't want to listen on network (only socket - safer)
# skip-networking

and un-comment the following:

# WARNING
# --------
# If you uncomment mysqld1 than make absolutely sure, that database mysql,
# configured above, is not started.  This may result in corrupted data!
#
[mysqld1]
port       = 3306
datadir    = /var/lib/mysql
pid-file   = /var/lib/mysql/mysqld.pid
socket     = /var/lib/mysql/mysql.sock
user       = mysql

and saving these changes to /etc/my.cnf

Then I executed the following to restart mariaDB/mysql, what OpenSUSE refers to mysql.service:

davids@DASmith-Thinkpad-01:~> sudo systemctl restart mysql.service
root's password:

When I checked the status of the mysql.service, it reported as follows:

davids@DASmith-Thinkpad-01:~> sudo systemctl status -l mysql.service
mysql.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
   Active: active (running) since Thu 2016-12-29 17:40:04 EST; 36s ago
  Process: 14367 ExecStartPost=/usr/lib/mysql/mysql-systemd-helper wait (code=exited, status=0/SUCCESS)
  Process: 14357 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
  Process: 14349 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
 Main PID: 14366 (mysqld)
   CGroup: /system.slice/mysql.service
           └─14366 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql

Dec 29 17:40:03 DASmith-Thinkpad-01.site systemd[1]: Starting MySQL server...
Dec 29 17:40:03 DASmith-Thinkpad-01.site mysql-systemd-helper[14367]: Waiting for MySQL to start
Dec 29 17:40:03 DASmith-Thinkpad-01.site mysql-systemd-helper[14366]: 161229 17:40:03 [Note] /usr/sbin/mysqld (mysqld 10.0.27-MariaDB) starting as process 14366 ...
Dec 29 17:40:04 DASmith-Thinkpad-01.site mysql-systemd-helper[14367]: MySQL is alive
Dec 29 17:40:04 DASmith-Thinkpad-01.site systemd[1]: Started MySQL server.
davids@DASmith-Thinkpad-01:~>

No errors reported!

Then I execute the following to create the database for Amarok:

davids@DASmith-Thinkpad-01:~> mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.0.27-MariaDB openSUSE package

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB (none)]> CREATE USER 'amarokuser'@'localhost' IDENTIFIED BY 'amarokpass';
Query OK, 0 rows affected (0.00 sec)

MariaDB (none)]> CREATE DATABASE amarokdb;
Query OK, 1 row affected (0.01 sec)

MariaDB (none)]> GRANT ALL ON amarokdb.* TO 'amarokuser'@'%' IDENTIFIED BY 'amarokpass';
Query OK, 0 rows affected (0.01 sec)

MariaDB (none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB (none)]> exit
Bye
davids@DASmith-Thinkpad-01:~>

I then restart the mysql.service as follows:

davids@DASmith-Thinkpad-01:~> sudo systemctl restart mysql.service
root's password:

and verify that the mysql.service is proporly running with:

davids@DASmith-Thinkpad-01:~> sudo systemctl status -l mysql.service
mysql.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
   Active: active (running) since Thu 2016-12-29 19:26:43 EST; 1min 8s ago
  Process: 15316 ExecStartPost=/usr/lib/mysql/mysql-systemd-helper wait (code=exited, status=0/SUCCESS)
  Process: 15306 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
  Process: 15296 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
 Main PID: 15315 (mysqld)
   CGroup: /system.slice/mysql.service
           └─15315 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql

Dec 29 19:26:41 DASmith-Thinkpad-01.site systemd[1]: Starting MySQL server...
Dec 29 19:26:42 DASmith-Thinkpad-01.site mysql-systemd-helper[15316]: Waiting for MySQL to start
Dec 29 19:26:42 DASmith-Thinkpad-01.site mysql-systemd-helper[15315]: 161229 19:26:42 [Note] /usr/sbin/mysqld (mysqld 10.0.27-MariaDB) starting as process 15315 ...
Dec 29 19:26:43 DASmith-Thinkpad-01.site mysql-systemd-helper[15316]: MySQL is alive
Dec 29 19:26:43 DASmith-Thinkpad-01.site systemd[1]: Started MySQL server.
davids@DASmith-Thinkpad-01:~>

which it is! Wow!!! :slight_smile:

Now hopefully this will work with Amarok after I configure Amarok to use it.

This was an odd experianse for me because after I initially installed mariaDB and all it’s dependencies, it complained that it couldn’t find the libjemalloc.so.1 file and I searched and searched for a few days for the rpm package containing this file before I found it yesterday. It seems like this rpm package should have been linked as one of mariaDB’s required dependencies to be automatically installed with mariaDB in order for the mariaDB rpm package to work.

Come on guys, mariaDB isn’t a MS software project as of yet? :wink:

Anyway, thanks for reading this,

David A. Smith

We are just users too no developers here. If you want to contribute to fixing it post a bugzilla bug

To the OP,

Looks like you broke a cardinal rule installing and setting up mysql/mariadb today… You didn’t set up your security configuration immediately. You found one way to address your problem by manually editing the my.cnf file, but typically you still won’t be doing all that’s necessary.

Today’s mysql/mariadb packages include a script that walks you through what is required, you just need to execute the following in a console and answer the questions. If you want to re-configure later (like switching between local only access vs allowing network access) you only need to re-run the script

mysql_secure_installation

Also, if you find yourself needing to automate installing and configuring mysql/mariadb or if you want to standardize how mysql/mariadb is set up, I wrote a Wiki article describing how you can use a Here Doc that does all that for you in one click
https://en.opensuse.org/User:Tsu2/MySQL_and_Mariadb

This should all be done before you start up mysql/mariadb for the first time.
If you have started the service, then you will need to reload the service or all services which I describe in this Wiki article I wrote…
(As I describe in the Wiki, any time a configuration is changed, you have to reload)
https://en.opensuse.org/User:Tsu2/systemd_commands

TSU