安装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. JS代码运行延迟

    还是上篇文章的项目. 现在是屏幕上需要显示九张图表,刚好用一张3X3的表格来显示.但是负责这块内容的同事始终没法让九张图表同时显示,有些图表的位置空了出来. 大家百思不得其解,最后只得求助技术经理. ...

  2. 2019-CCPC广东省赛总结

    2018年11月第一次参加ICPC区域赛青岛赛区,打铁了! 2019年5月第一次参加CCPC广东省赛,4题滚粗,C题莫队TLE13发,只拿了个铜牌! 教训总结: 比赛时千万不能犹豫,不能犹豫,不能犹豫 ...

  3. HTML——表单

    总结: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...

  4. Model中的验证规则

    一.能够使用Model的Attribute进行服务端数据验证 本文目录 一.概述 二.MVC提供的常用上下文 三.自定义正则表达式验证 一.概述 为了确保数据的安全性,由Client发送到服务端的每一 ...

  5. ORACLE行转列通用过程(转)

    1.使用视图 SQL code? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 create or r ...

  6. 【踩坑】spring每次请求后session不一样导致无法在服务器保存信息

    根据网上的资料,若想在服务器用session保存一些信息,方法如下: public Xclass Xmethod(HttpServletRequest request, HttpSession ses ...

  7. 对fgets末尾'\0'的处理

    之所以要对fgets自动添加的字符进行处理的原因之一是:当你想比较输入的字符时,你会发现输入的字符和源码用来进行对比的字符一模一样,但是使用strcmp比较时就是不一样,原因就是fgets对输入字符添 ...

  8. nodeis 避免回调引起的栈溢出 Maximum call stack size exceeded

    //如果这样写,会发生栈溢出 var i = 1; function isEven() {      console.log(i++); // return isEven();        retu ...

  9. GCD 代码以及GCD思想

    # 欧几里得算法 现在,我们来学习一下欧几里得算法. 欧几里得算法又称辗转相除法,主要用于算求两个正数之间的最大公约数.对于最大公约数这个名称,其英文名称为(Greatest Common Divis ...

  10. vue 中根据地址名称获取实际经纬度方法

    <div id="container" class="map" style="margin-top:30px; width: 1200px;he ...