sudo pacman -S mysql
Add one new user was called “mysql”.
sudo useradd mysql
Change mysql’s owner
sudo chown mysql:mysql /var/lib/mysql/ -Rf
You need to initialize the MariaDB data directory prior to starting the service.
sudo mysql_install_db –user=mysql –basedir=/usr –datadir=/var/lib/mysql
Mysql(mariaDB) will create mysqld.sock under “/var/run/mysqld”, so I need to prepare right folder and right permission of folder for mysql(mariaDB).
sudo mkdir /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld/
Start mysql(mariaDB) now
sudo systemctl start mysqld
Start mysql(mariaDB) after booting.
sudo systemctl enable mysqld
Reference:
0 意見:
張貼留言