Mysql install: Difference between revisions

From wikinotes
Line 1: Line 1:
= Linux =
= Archlinux =
<blockquote>
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 04:04, 11 September 2022

Archlinux

sudo pacman -S mariadb
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mariadb
sudo systemctl start  mariadb

## you can then modify the database as the user `root`
## `mysql -u root`

FreeBSD

sudo pkg install mysql57-server
echo "MYSQL_ENABLE=\"YES\"" >> /etc/rc.conf
sudo service mysql-server start

Starting with mysql-5.7, a temporary root password is assigned.
You must reassign it to use the database.

mysql -u root --password=$(cat /root/.mysql_secret | tail -n1)
ALTER USER `root`@`localhost` IDENTIFIED BY 'some-password';
FLUSH PRIVILEGES;