最近在用ArchLinux在虚拟机里学习Linux。现在想在ArchLinux中安装WordPress,首先就需要安装MySql数据库。但是在MySql被Oracle收购之后,很多开源支持者就转而使用MariaDb了。不过MariaDb也和MySql兼容的,所以基本不用有什么担心。由于ArchLinux只带了MariaDb,所以我们就用MariaDb来代替MySql。

安装MariaDb和其客户端工具,

sudo pacman -S mariadb mariadb-clients

安装完成之后,会出现如何开启MariaDb的提示:

:: You need to initialize the MariaDB data directory prior to starting

the service. This can be done with mysql_install_db command, e.g.:

mysql_install_db –user=mysql –basedir=/usr –datadir=/var/lib/mysql

根据提示,我们运行如下命令就可以初始化MariaDb的数据目录了。

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

在经过一长串提示信息之后,就会出现相应的如何开启MariaDb的帮助信息:

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 mypc 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

Support MariaDB development by buying support/new features from MariaDB

Corporation Ab. You can contact us about this at [email protected]

Alternatively consider joining our community based development effort:

http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

同样根据提示,我们首先需要先启动MariaDb,

sudo systemctl start mysqld

然后为root用户设置一个新密码,

mysqladmin -u root password '12345678'

然后尝试登录MariaDb,如果登录成功,说明配置完成了,

mysql -uroot -p 12345678

sudo systemctl enable mysqld

archlinux安装mysql_在Arch Linux中安装MySQL相关推荐

  1. linux内核如何安装vim,如何在Linux 中安装和使用 PacVim?

    描述 你好,Vim用户!今天,我偶然发现了一个很酷的程序来提高 Vim 的使用技巧.Vim 是编写和编辑代码的绝佳编辑器.然而,你们中的一些人(包括我)仍在陡峭的学习曲线中挣扎.再也不用了!来看看 P ...

  2. linux中安装pip_如何在Linux中安装PIP

    linux中安装pip In this tutorial, we'll go over the steps to install pip in Linux. The pip command allow ...

  3. caffe-gpu ubuntu 安装_如何在Linux中安装vnStat和vnStati监视网络流量

    VnStat是针对Linux和BSD的基于控制台的网络流量监视工具设计.它将保留所选网络接口的网络流量日志.为了生成日志,vnStat使用内核提供的信息. 换句话说,它不会嗅探网络流量,并且可以确保系 ...

  4. ubuntu 安装yum_如何在 Linux 中安装微软的 .NET Core SDK | Linux 中国

    本分步操作指南文章解释了如何在 Linux 中安装 .NET Core SDK 以及如何使用 .NET 开发出第一个应用程序.-- Sk致谢译自 | ostechnix.com 作者 | Sk译者 | ...

  5. 如何在 Arch Linux 中安装 DNSCrypt 和 Unbound

    DNSCrypt 是一个用于对 DNS 客户端和 DNS 解析器之间通信进行加密和验证的协议.它可以阻止 DNS 欺骗或中间人攻击. DNSCrypt 可用于大多数的操作系统,包括 Linux,Win ...

  6. Linux怎么卸载unbound,系统运维|如何在 Arch Linux 中安装 DNSCrypt 和 Unbound

    DNSCrypt 是一个用于对 DNS 客户端和 DNS 解析器之间通信进行加密和验证的协议.它可以阻止 DNS 欺骗或中间人攻击. DNSCrypt 可用于大多数的操作系统,包括 Linux,Win ...

  7. arch 还原pacman_如何使用Pacman在Arch Linux中安装Go

    arch 还原pacman Using the Arch Linux Package Manager (pacman) is the easiest way to install Go. Based ...

  8. linux查看是否安装mysql_如何查看linux是否安装mysql

    展开全部 查看linux是否安装mysql有以下7步:e5a48de588b662616964757a686964616f31333365643662 1.使用命令 # service mysqld ...

  9. mac 二进制安装mysql_如何在MAC中安装mysql二进制分发版

    如何在MAC电脑中安装mysql二进制分发版,对于这个问题,许多用户都还不是很清楚,其实解决的方法也不难,那么具体该怎么做呢?现在小编就告诉大家解决的方法吧. 没有mac的root密码,当前用户有su ...

  10. nginx 在阿里云怎么安装mysql_阿里云Linux服务器安装 nginx+mysql+php

    阿里云Linux服务器安装 nginx+mysql+php 步骤 1.登录服务器 2.下载安装包 3.将安装包上传到服务器的/home目录下 注:使用rz sz命令进行本地和服务器间的上传.下载,安装 ...

最新文章

  1. java正则截取xml节点_实例讲述Java使用正则表达式截取重复出现的XML字符串功能...
  2. LINUX 硬链接与软链接的区别
  3. hihocoder #1388 : Periodic Signal NTTFFT
  4. Windows下配置sphinx+reStructuredText详解
  5. [转载] Java8 Stream流遍历 如何使用索引
  6. 计算机操作视频及运用方式,电脑上可以使用什么方法来编辑、制作视频?
  7. yii2 跨域请求配置_如何在SpringBoot应用中实现跨域访问资源和消息通信?
  8. 小卷积核的特征图与卷积参数变化不大,计算量变化明显
  9. ubuntu下qt+科大讯飞语音库的导入方法
  10. (八)列表操作2(函数番外篇)
  11. mtk处理器和骁龙对比_3500元以内手机的绝杀?首款MTK 天玑1000处理器手机IQOO Z发布...
  12. 四大检索工具 和 论文查找网址大全
  13. C语言入门,C语言学习方法,初学者必看
  14. JS逆向|使用pyexecjs库替换加密字符串
  15. 如何查看yandex文字搜索广告的搜索词?
  16. java 天数计算日期_Java 计算日期间天数与日期推算等操作
  17. Android创建前台运行的Service
  18. word遇到网络地址过长自动换行
  19. wetool个人版_wetoo群发wetool与企业-购买
  20. C++ 队列(queue)简介

热门文章

  1. 使用 T4 文本模板生成设计时代码
  2. spring入门——注入demo
  3. ireport +jasperreport 中文不能显示
  4. 20191113每日一句
  5. Writing a good ISMAR paper
  6. Origin打断图像的y坐标和在柱状图上显示数字
  7. 190314每日一句
  8. unity linerenderer在Game窗口中任意画线
  9. Atitit onvif 协议截图 getSnapshotUri 使用java
  10. Atitit.git的存储结构and 追踪