|
| 1 | +--- |
| 2 | +title: Mysql Setup on Antix Linux |
| 3 | +description: A guide to Setup Mysql on Antix Linux Runinit |
| 4 | +--- |
| 5 | + |
| 6 | +import { Tabs, TabItem } from "@astrojs/starlight/components"; |
| 7 | +import { Steps } from "@astrojs/starlight/components"; |
| 8 | + |
| 9 | +This guide will walk you through setting up MySql on Antix linux runinit system. [Reference](https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html) |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +<Steps> |
| 14 | +1. ### Adding the MySQL Apt Repository |
| 15 | + |
| 16 | + download the [MySQL APT Repo](https://dev.mysql.com/downloads/repo/apt/). |
| 17 | + Then install the package with dpkg |
| 18 | + |
| 19 | + ```sh |
| 20 | + sudo dpkg -i ~/Downloads/mysql-apt-config_0.8.34-1_all.deb |
| 21 | + ``` |
| 22 | + select `OK` when it prompts you to go with the default options |
| 23 | + |
| 24 | +2. ### Install MySQL Toolchain |
| 25 | + |
| 26 | + ```sh |
| 27 | + sudo apt update |
| 28 | + sudo apt install mysql-server |
| 29 | + ``` |
| 30 | + |
| 31 | + then set a password for the root user for MySQL when it asks |
| 32 | + |
| 33 | +3. ### Create a Service for your `Init System` |
| 34 | + |
| 35 | + <Tabs synckey="init" > |
| 36 | + <TabItem label="Runinit" > |
| 37 | + ```sh |
| 38 | + sudo mkdir -p /etc/sv/mysql |
| 39 | + sudo tee /etc/sv/mysql/run > /dev/null <<'EOF' |
| 40 | + #!/bin/sh |
| 41 | + exec chpst -u mysql /usr/sbin/mysqld |
| 42 | + EOF |
| 43 | + sudo chmod +x /etc/sv/mysql/run |
| 44 | + sudo ln -s /etc/sv/mysql /var/service/ |
| 45 | + ``` |
| 46 | + Now runit will detect and manage MySQL service |
| 47 | + </TabItem> |
| 48 | + <TabItem label="SystemV" > |
| 49 | + ```sh |
| 50 | + // TODO: Need to complete this code snippet |
| 51 | + ``` |
| 52 | + Now runit will detect and manage MySQL service |
| 53 | + </TabItem> |
| 54 | + </Tabs> |
| 55 | +
|
| 56 | +4. Test if Eveything worked |
| 57 | +
|
| 58 | + ```sh |
| 59 | + mysql -u root -p |
| 60 | + ``` |
| 61 | +
|
| 62 | +</Steps> |
| 63 | +
|
| 64 | +## Change Root Password (Optional) |
| 65 | +
|
| 66 | +<Steps> |
| 67 | +
|
| 68 | +1. Open mysql shell |
| 69 | +
|
| 70 | + ```sh |
| 71 | + sudo mysql |
| 72 | + ``` |
| 73 | +
|
| 74 | +2. run command to change Password |
| 75 | +
|
| 76 | + ```sql |
| 77 | + ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourPasswordHere'; |
| 78 | + FLUSH PRIVILEGES; |
| 79 | + EXIT; |
| 80 | + ``` |
| 81 | +
|
| 82 | +</Steps> |
0 commit comments