Linux Deploy Ubuntu 20.04 安装 mariadb

Linux Deploy Ubuntu 20.04 安装 mariadb,第1张

1.安亮缺装mariadb-server

2.运行mysql_install_db

正敬链辩常运行完成后可以看到如下:

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !

To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'

'/usr/bin/mysqladmin' -u root -h localhost password 'new-password'

Alternatively you can run:

'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the

MySQL manual for more instructions.

You can start the MariaDB daemon with:

cd '/usr' /usr/bin/mysqld_safe --datadir='唤咐/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl

cd '/usr/mysql-test' perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.

You can find additional information about the MySQL part at:

http://dev.mysql.com

Consider joining MariaDB's strong and vibrant community:

https://mariadb.org/get-involved/

3. 给mysql用户配置权限

4. 启动mariadb

5. 运行mysql_secure_installation

6. 更改字符集

7. 最后查看字符集

完成。

mariadb和mysql师出同门。使用的命令方法可以说是一模一样的。

安装mariaDB服务程序:

[root@linuxprobe ~]# yum install mariadb mariadb-server

启动mariadb服务程序并添加到开机启动项中:

[root@linuxprobe ~]# systemctl start mariadb

[root@linuxprobe ~]# systemctl enable mariadb

初始化工作:

第1步:设定root用户密码。

第2步:删除匿名帐号差棚。

第3步:禁止root用户从远程登录。

第4步:删除test数据库并取消对其的访问权限。

第5步:刷新授权表,让初始化后的设定立即生效。

初始化数据库服务程序:

[root@linuxprobe ~]# mysql_secure_installation

设置防火墙对数据库服务的允许策略:

[root@linuxprobe ~]# firewall-cmd --permanent --add-service=mysql

success

[root@linuxprobe ~]# firewall-cmd --reload

使用root用户登录到数据库汪脊中:

[root@linuxprobe ~]# mysql -u root -p

Enter password: 此处输入root用户在数据库中的密码。

Welcome to the MariaDB monitor. Commands end with  or \g.

可以试试注意我,这个Linux是7版的Linux可以用centos7 试试。如果你需要在6版的系统中虚陵则使用的话就需要源码安装了。学习Linux建议参考《Linux就该这样学》,运维开发都需要多练习,多思考,多敲。加油吧


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12426326.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存