Skip to content

Mysql Setup on Antix Linux

This guide will walk you through setting up MySql on Antix linux runinit system. Reference

Installation

  1. Adding the MySQL Apt Repository

    download the MySQL APT Repo. Then install the package with dpkg

    Terminal window
    sudo dpkg -i ~/Downloads/mysql-apt-config_0.8.34-1_all.deb

    select OK when it prompts you to go with the default options

  2. Install MySQL Toolchain

    Terminal window
    sudo apt update
    sudo apt install mysql-server

    then set a password for the root user for MySQL when it asks

  3. Create a Service for your Init System

    sudo mkdir -p /etc/sv/mysql
    sudo tee /etc/sv/mysql/run > /dev/null <<'EOF'
    #!/bin/sh
    exec chpst -u mysql /usr/sbin/mysqld
    EOF
    sudo chmod +x /etc/sv/mysql/run
    sudo ln -s /etc/sv/mysql /var/service/

    Now runit will detect and manage MySQL service

  4. Test if Eveything worked

    Terminal window
    mysql -u root -p

Change Root Password (Optional)

  1. Open mysql shell

    Terminal window
    sudo mysql
  2. run command to change Password

    ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourPasswordHere';
    FLUSH PRIVILEGES;
    EXIT;

Common Problem

when running $: mysql -u root -p if you get ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Terminal window
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld