hello, I installed mariadb but I can not make it go.
so i delete mysqld.conf from my.conf ; It remained like this:
socket = /run/mysqld/
i leave the blank password and tried with 'root' or 'new-password'
then made this
sudo ls /run/mysqld/
give nothing
sudo ls -la /etc/mysql/
total 24
drwxr-xr-x 2 root root 4096 oct 25 20:00 .
drwxr-xr-x 80 root root 4096 oct 29 13:27 ..
-rw-r--r-- 1 root root 4893 oct 29 14:19 my.cnf
-rw-r--r-- 1 root root 3479 oct 29 14:14 wsrep.cnf
ls -l /usr/lib/tmpfiles.d/ | grep maria
-rw-r--r-- 1 root root 69 oct 29 13:02 mariadb.conf
inside that mariadb.conf
d /run/mysqld 0755 mysql mysql -
d /var/lib/mysql 0755 mysql mysql -
inside my.conf:
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
That doesn't start mariadb. It just installs the local user database. You need to do that first
before attempting to start mariadb. I'm not totally sure from your OP, but did you try logging into mariadb
after you first set up the database? That is, running "mysql -u root -p" after you did "sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql".
umm - you are not starting the server, FWIW
Basically what @Dudemanguy said. To autorun it as a service you'll also need to:
pacman -S mysql-openrc
or
pacman -S mysql-runit
depending on the init system used and if you haven't done so already. Also you'll need to activate the service. Consult the wiki (https://wiki.artixlinux.org/) on how to do that for particular init system.
thanks, now i got this error
sudo rc-service mysql start
* Checking mysqld configuration for mysql ... [ ok ]
* Starting mysql ...
* MySQL datadir `' is empty or invalid
* Please check your config file `/etc/mysql/my.cnf'
* ERROR: mysql failed to start
i tried
sudo rm -rf /var/lib/mysql/*
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo chown mysql:mysql /var/lib/mysql/*
still giving that error
cd /var/lib/mysql ; sudo mysqld --initialize --user=mysql
error dont recognize initialize
my host name is juan-pc so i look for log file:
sudo find / -name 'juan-pc.err'
nothing
/var/log/mysql dont exist
I can reproduce it and confirm that on normal installation this is the case. To fix it, check file
/etc/mysql/my.cnf for these entries under
[mysqld] label and write them if they are not present:
basedir = /usr
datadir = /var/lib/mysql
user = mysql
pid-file = /run/mysqld/mysqld.pid
After those entries are added to
my.cnf, the service starts fine.
I wrote an init stript for openrc
i made the changes on my.conf and its working, also i needed to specify the socket under [mysqld]. the install was with
sudo pacman -S mysql
i saw the init script but not sure if if it would work in my case.
SOLVED
thank you
Just wanted to point out that this command is MANDATORY, I saw it 2 hours ago, trying to solve a similar problem
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (111)
ERROR 2013 (HY000): Lost connection to server at 'handshake: reading initial communication packet', system error: 104
Well that was the cure to it.. as mentioned on reddit
https://www.reddit.com/r/artixlinux/comments/lga6f0/how_to_install_and_run_mysql/
First of all, this thread is almost three years old. A lot has changed regarding Artix Linux in the meantime.
Next, I highly suggest using MariaDB instead of MySQL. The two programs are almost identical, except that MySQL is now owned by Oracle, and MariaDB is Free Software. MySQL is dual-licensed under GPL v2 and proprietary license, while MariaDB is fully GPL.
MySQL is not supported by Artix, while MariaDB has packages for all init systems supported by Artix and doesn't require additional setup (aside from usual setting up of users, their passwords and databases).
https://en.wikipedia.org/wiki/MariaDB
https://en.wikipedia.org/wiki/MySQL
The names of the two programs come from the names of the author's two daughters, My and Maria.