当前位置:网站首页>CentOS essay 03:centos8.2 installing MySQL

CentOS essay 03:centos8.2 installing MySQL

2022-06-11 08:23:00 uikoo9

【mysql/mariadb】

Because Tencent cloud light application server is used , Here to install mariadb replace

 

【dnf/yum】

dnf yes yum Upgrade of package manager , Both commands can be used on the server , It is recommended to use dnf Management package

 

【 retrieval mariadb】

dnf search mariadb

adopt search Command can retrieve application packages that can be installed

 

【 install mariadb】

dnf install mariadb mariadb-server

  stay centos You need to install mariadb and mariadb-server Two bags

【 initialization mysql】

mysql_install_db --user=mysql

Through the initialization command , Can be initialized mysql, After successful initialization, there are some prompts

 

【 start-up mariadb service 】

systemctl start mariadb
systemctl enable --now mariadb

  start-up mariadb Service for , And configure it into the startup item

【 Set up root password 】

mysqladmin -u root password 'zzzzzz'

Use this command to set root Password , Try to make it as complex as possible

【 Open some security settings 】

mysql_secure_installation

Open some security settings by prompting ,

Are some common operations

1. Set up root password

2. Delete irrelevant users

3. Prohibition of non root Account login

4. Delete test database

5. Refresh permissions, etc

 

【 land mysql】

mysql -uroot -p

Enter the previously set password , You can log in mysql 了  

 

【 sense 】

Now install mysql, It's much simpler than before ~

 

原网站

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