[SOLVED]set up mysql/mariadb 29 October 2018, 18:35:22 hello, I installed mariadb but I can not make it go.QuotemysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.conf' (2 "No such file or directory") so i delete mysqld.conf from my.conf ; It remained like this: socket = /run/mysqld/QuotemysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/' (13 "Permission denied")sudo mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/' (111 "Connection refused") mysql -u root -pEnter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/' (13 "Permission denied")i leave the blank password and tried with 'root' or 'new-password'then made thisQuotesudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlsudo ls /run/mysqld/give nothingsudo ls -la /etc/mysql/total 24drwxr-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.cnfQuotels -la /var/lib/mysql/total 110680drwxr-xr-x 5 mysql mysql 4096 oct 26 14:35 .drwxr-xr-x 27 root root 4096 oct 29 12:30 ..-rw-rw---- 1 mysql mysql 16384 oct 26 14:35 aria_log.00000001-rw-rw---- 1 mysql mysql 52 oct 26 14:35 aria_log_control-rw-rw---- 1 mysql mysql 12582912 oct 26 14:35 ibdata1-rw-rw---- 1 mysql mysql 50331648 oct 26 14:35 ib_logfile0-rw-rw---- 1 mysql mysql 50331648 oct 26 14:34 ib_logfile1drwx------ 2 mysql mysql 4096 oct 26 14:35 mysql-rw-rw---- 1 mysql mysql 27996 oct 26 14:35 mysql-bin.000001-rw-rw---- 1 mysql mysql 346 oct 26 14:35 mysql-bin.000002-rw-rw---- 1 mysql mysql 1510 oct 26 14:35 mysql-bin.000003-rw-rw---- 1 mysql mysql 57 oct 26 14:35 mysql-bin.index-rw-rw---- 1 mysql mysql 7 oct 26 14:35 mysql-bin.statedrwx------ 2 mysql mysql 4096 oct 26 14:35 performance_schemadrwx------ 2 mysql mysql 4096 oct 26 14:34 testls -l /usr/lib/tmpfiles.d/ | grep maria-rw-r--r-- 1 root root 69 oct 29 13:02 mariadb.confinside that mariadb.conf d /run/mysqld 0755 mysql mysql -d /var/lib/mysql 0755 mysql mysql -inside my.conf:Quote# The following options will be passed to all MariaDB clients[client]#password = ''port = 3306socket = /run/mysqld/# The MariaDB server[mysqld]port = 3306socket = /run/mysqldskip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8M# Point the following paths to different dedicated disks#tmpdir = /tmp/ Last Edit: 05 November 2018, 00:35:29 by tefenet
Re: set up mysql/mariadb Reply #1 – 29 October 2018, 21:42:54 Code: [Select]sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlThat 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".
Re: set up mysql/mariadb Reply #2 – 30 October 2018, 04:52:36 Quote from: tefenet – on 29 October 2018, 18:35:22hello, 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 thissudo ls /run/mysqld/give nothingsudo ls -la /etc/mysql/total 24drwxr-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.cnfls -l /usr/lib/tmpfiles.d/ | grep maria-rw-r--r-- 1 root root 69 oct 29 13:02 mariadb.confinside that mariadb.conf d /run/mysqld 0755 mysql mysql -d /var/lib/mysql 0755 mysql mysql -inside my.conf:umm - you are not starting the server, FWIW
Re: set up mysql/mariadb Reply #3 – 30 October 2018, 11:31:03 Basically what @Dudemanguy said. To autorun it as a service you'll also need to:Code: [Select]pacman -S mysql-openrc or Code: [Select]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 on how to do that for particular init system. 1 Likes
Re: set up mysql/mariadb Reply #4 – 30 October 2018, 14:30:05 thanks, now i got this errorsudo 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 starti tried sudo rm -rf /var/lib/mysql/*sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlsudo chown mysql:mysql /var/lib/mysql/*still giving that error cd /var/lib/mysql ; sudo mysqld --initialize --user=mysqlerror 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 Last Edit: 30 October 2018, 14:58:12 by tefenet
Re: set up mysql/mariadb Reply #5 – 30 October 2018, 15:41:56 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:Code: [Select]basedir = /usrdatadir = /var/lib/mysqluser = mysqlpid-file = /run/mysqld/mysqld.pidAfter those entries are added to my.cnf, the service starts fine. 1 Likes
Re: set up mysql/mariadb Reply #6 – 31 October 2018, 03:29:46 Quote from: Everyone – on 30 October 2018, 15:41:56I 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:Code: [Select]basedir = /usrdatadir = /var/lib/mysqluser = mysqlpid-file = /run/mysqld/mysqld.pidAfter those entries are added to my.cnf, the service starts fine.I wrote an init stript for openrc
Re: set up mysql/mariadb Reply #7 – 05 November 2018, 00:34:51 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 mysqli saw the init script but not sure if if it would work in my case.SOLVEDthank you
Re: [SOLVED]set up mysql/mariadb Reply #8 – 02 August 2021, 21:42:44 Quote from: Dudemanguy – on 29 October 2018, 21:42:54Code: [Select]sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlThat 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".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: 104Well that was the cure to it.. as mentioned on reddithttps://www.reddit.com/r/artixlinux/comments/lga6f0/how_to_install_and_run_mysql/
Re: [SOLVED]set up mysql/mariadb Reply #9 – 03 August 2021, 12:29:14 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/MariaDBhttps://en.wikipedia.org/wiki/MySQLThe names of the two programs come from the names of the author's two daughters, My and Maria. Last Edit: 03 August 2021, 12:37:37 by strajder