当前位置:网站首页>Archlinux install MySQL

Archlinux install MySQL

2022-07-07 23:16:00 JUSTfFUN

explain

Official recommendation MariaDB To replace MySQL

The following is a ArckWiki original text :

Be careful : since 2013 From the year onwards ,MariaDB I was Arch Linux As the official default MySQL Realization [1].Oracle MySQL Has been moved to AUR, It is recommended that all users upgrade to MariaDB. See this announcement .

Links to this article : ArchWiki About MariaDB

install

sudo pacman -S mariadb
 install  mariadb  After the package , You have to start  mariadb.service  Run the following command before :
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl start mariadb.service( Use start perhaps enable mariadb.service)

To configure

The default password is empty

sudo mysql -p -u root

Add new user

The following is to create a password for ’some_pass’ Of ’monty’ Examples of users , And give mydb Full operation permission :

$ sudo mysql -u root -p

MariaDB> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
MariaDB> GRANT ALL PRIVILEGES ON mydb.* TO 'monty'@'localhost';
MariaDB> FLUSH PRIVILEGES;
MariaDB> quit

Add users according to your own needs

Enable auto completion

MySQL The client auto completion function is disabled by default . To enable it throughout the system , edit /etc/my.cnf.d/mysql-clients.cnf, stay mysql Next add to auto-rehash. Be careful : Don't put auto-rehash Written in mysqld Next , Automatic completion will be enabled the next time the client starts .

原网站

版权声明
本文为[JUSTfFUN]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130600074211.html