安装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 sales@mariadb.com.
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 -p12345678

如果想要MariaDb开机自动启动,那么就运行以下命令,

sudo systemctl enable mysqld
---------------------
作者:过了即是客
来源:CSDN
原文:https://blog.csdn.net/u011054333/article/details/53203787
版权声明:本文为博主原创文章,转载请附上博文链接!

在ArchLinux、manjaro中安装MySql(mariaDB)的更多相关文章

  1. 记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb

    记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb 前段时间我个人Google服务器意外不能用,并且我犯了一件很低级的错误,直接在gcp讲服 ...

  2. 如何在RedHat 7.0系统中安装mysql 5.7.22

    如何在RedHat 7.0系统中安装mysql 5.7.22 今天给大家介绍一下如何安装mysql5.7,在安装之前,首先要查看的是,你的系统中有没有已经安装过的情况.键入rpm -qa|grep m ...

  3. 20190526 - CentOS 7 中 安装 MySQL 8 并授权 root 远程访问

    1. CentOS 7 中 安装 MySQL 8 CentOS 7 中内置 MariaDB 建议升级一下用,性能好很多.但如果一定要用 MySQL 8,就得自己装. 坦白的说,Oracle 升级 My ...

  4. ubuntu 安装 mysql mariadb

    本教程面向Ubuntu服务器,适用于Ubuntu的任何LTS版本,包括Ubuntu 14.04,Ubuntu 16.04,Ubuntu 18.04,甚至非LTS版本(如Ubuntu 17.10和其他基 ...

  5. 在docker中安装mysql

    #!/bin/sh # 安装docker # 在docker中安装mysql # 解决了docker容器中无法输入中文的问题 ##########################安装docker # ...

  6. centos 7 中安装 mysql 5.7

    centos 7 中安装 mysql 5.7 环境说明: 查看centos的版本:cat /etc/redhat-release 安装和配置步骤: 下载 mysql 源安装包: sudo curl - ...

  7. win7中安装mysql

    这篇文章主要介绍了如何在win7中安装mysql,所以加上了MySQL的下载过程,希望对需要的人有所帮助大家都知道MySQL是一款中.小型关系型数据库管理系统,很具有实用性,对于我们学习很多技术都有帮 ...

  8. Windows10系统的Linux子系统中安装MySQL数据库心得

    后端开发童鞋们, 自己开发机用的是Windows系统电脑(台式机或笔记本), 而开发的程序和使用的数据库等要运行在Linux服务器上, 这种情况有木有? 提前声明: 本文并不讨论操作系统的比较, 以及 ...

  9. Windows server 2008 R2中安装MySQL !

    我今天打算在Windows server 2008 R2中安装MySQL,可是总是发现ODBC连接器安装错误,无论我采用MySQL的整体安装包,还是单独的ODBC连接器安装文件!! 最后上网搜索了很久 ...

随机推荐

  1. 获取所有bean的名字

    import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.facto ...

  2. python中“生成器”、“迭代器”、“闭包”、“装饰器”的深入理解

    python中"生成器"."迭代器"."闭包"."装饰器"的深入理解 一.生成器 1.生成器定义:在python中,一边 ...

  3. NET Core 2.0使用Cookie认证实现SSO单点登录

    NET Core 2.0使用Cookie认证实现SSO单点登录 之前写了一个使用ASP.NET MVC实现SSO登录的Demo,https://github.com/bidianqing/SSO.Sa ...

  4. 如何给数组用fill函数和memset函数给数组赋初值

    fill是按照单元来赋值的,所以可以填充一个区间的任意值 #include<iostream> #include<stdio.h> #include<string.h&g ...

  5. clickhouse源码Redhat系列机单机版安装踩坑笔记

    前情概要 由于工作需要用到clickhouse, 这里暂不介绍概念,应用场景,谷歌,百度一大把. 将安装过程踩下的坑记录下来备用 ClickHouse源码 git clone安装(直接下载源码包安装失 ...

  6. Aspose.word直接转pdf

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  7. windows live writer 安装失败 0x80190194 解决方法

    windows live writer已经停止更新,部分安装包无法下载. 改安装windows软件包即可,其中包含windows live writer的安装. 参考: http://jingyan. ...

  8. 【转】LINQ to SQL语句(1)之Where

    Where操作 适用场景:实现过滤,查询等功能. 说明:与SQL命令中的Where作用相似,都是起到范围限定也就是过滤作用的,而判断条件就是它后面所接的子句. Where操作包括3种形式,分别为简单形 ...

  9. sqlserver跟据当天年月日日期查询数据库当天数据

    select * from Client where  CONVERT(varchar(100), Cli_Datetime, 23) ='2017-11-06' 在查询之前要对表中datetime类 ...

  10. jquery阻止网页中右键的点击

    <body onmousedown="whichElement(event)"> </body> function whichElement(e) { if ...