首頁 資料庫 mysql教程 centos7安装mariadb的正确命令

centos7安装mariadb的正确命令

Jun 07, 2016 pm 04:02 PM
centos7 li mariadb 命令 安裝 正確 用的

使用的是linode的centos7系统,安装mysql发现已经默认的是mariadb。 但是不管是使用linode官网说明还是百度搜索到的的根本安装方法无法安装成功。 总是提示这一句: ERROR 2002 (HY000): Cant connect to local MySQL server through socket /var/lib/mysql/

使用的是linode的centos7系统,安装mysql发现已经默认的是mariadb。

但是不管是使用linode官网说明还是百度搜索到的的根本安装方法无法安装成功。

总是提示这一句:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

最后通过google 搜索 install mariadb on centos 7得到了安装的关键一步。

现在安装成功,特此备注一下整个安装过程:

mysql:[root@localhost ~]# yum -y install mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-bench.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-devel.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-embedded.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-embedded-devel.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-libs.x86_64 1:5.5.37-1.el7_0 will be installed
---> Package mariadb-server.x86_64 1:5.5.37-1.el7_0 will be installed
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.37-1.el7_0.x86_64
---> Package mariadb-test.x86_64 1:5.5.37-1.el7_0 will be installed
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================
 Package                           Arch              Version                     Repository          Size
==========================================================================================================
Installing:
 mariadb                           x86_64            1:5.5.37-1.el7_0            updates            8.9 M
 mariadb-bench                     x86_64            1:5.5.37-1.el7_0            updates            385 k
 mariadb-devel                     x86_64            1:5.5.37-1.el7_0            updates            744 k
 mariadb-embedded                  x86_64            1:5.5.37-1.el7_0            updates            3.6 M
 mariadb-embedded-devel            x86_64            1:5.5.37-1.el7_0            updates            7.4 M
 mariadb-libs                      x86_64            1:5.5.37-1.el7_0            updates            752 k
 mariadb-server                    x86_64            1:5.5.37-1.el7_0            updates             11 M
 mariadb-test                      x86_64            1:5.5.37-1.el7_0            updates            7.9 M
Installing for dependencies:
 perl-DBD-MySQL                    x86_64            4.023-5.el7                 base               140 k

Transaction Summary
==========================================================================================================
Install  8 Packages (+1 Dependent package)

Total download size: 40 M
Installed size: 279 M
Downloading packages:
(1/9): mariadb-bench-5.5.37-1.el7_0.x86_64.rpm                                     | 385 kB  00:00:00
(2/9): mariadb-devel-5.5.37-1.el7_0.x86_64.rpm                                     | 744 kB  00:00:00
(3/9): mariadb-embedded-5.5.37-1.el7_0.x86_64.rpm                                  | 3.6 MB  00:00:00
(4/9): mariadb-5.5.37-1.el7_0.x86_64.rpm                                           | 8.9 MB  00:00:00
(5/9): mariadb-libs-5.5.37-1.el7_0.x86_64.rpm                                      | 752 kB  00:00:00
(6/9): mariadb-server-5.5.37-1.el7_0.x86_64.rpm                                    |  11 MB  00:00:00
(7/9): mariadb-embedded-devel-5.5.37-1.el7_0.x86_64.rpm                            | 7.4 MB  00:00:00
(8/9): mariadb-test-5.5.37-1.el7_0.x86_64.rpm                                      | 7.9 MB  00:00:00
(9/9): perl-DBD-MySQL-4.023-5.el7.x86_64.rpm                                       | 140 kB  00:00:00
----------------------------------------------------------------------------------------------------------
Total                                                                      36 MB/s |  40 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:mariadb-libs-5.5.37-1.el7_0.x86_64                                                   1/9
  Installing : 1:mariadb-5.5.37-1.el7_0.x86_64                                                        2/9
  Installing : perl-DBD-MySQL-4.023-5.el7.x86_64                                                      3/9
  Installing : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                 4/9
  Installing : 1:mariadb-devel-5.5.37-1.el7_0.x86_64                                                  5/9
  Installing : 1:mariadb-embedded-5.5.37-1.el7_0.x86_64                                               6/9
  Installing : 1:mariadb-embedded-devel-5.5.37-1.el7_0.x86_64                                         7/9
  Installing : 1:mariadb-test-5.5.37-1.el7_0.x86_64                                                   8/9
  Installing : 1:mariadb-bench-5.5.37-1.el7_0.x86_64                                                  9/9
  Verifying  : 1:mariadb-test-5.5.37-1.el7_0.x86_64                                                   1/9
  Verifying  : 1:mariadb-embedded-devel-5.5.37-1.el7_0.x86_64                                         2/9
  Verifying  : 1:mariadb-embedded-5.5.37-1.el7_0.x86_64                                               3/9
  Verifying  : 1:mariadb-libs-5.5.37-1.el7_0.x86_64                                                   4/9
  Verifying  : 1:mariadb-bench-5.5.37-1.el7_0.x86_64                                                  5/9
  Verifying  : 1:mariadb-5.5.37-1.el7_0.x86_64                                                        6/9
  Verifying  : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                 7/9
  Verifying  : perl-DBD-MySQL-4.023-5.el7.x86_64                                                      8/9
  Verifying  : 1:mariadb-devel-5.5.37-1.el7_0.x86_64                                                  9/9

Installed:
  mariadb.x86_64 1:5.5.37-1.el7_0                        mariadb-bench.x86_64 1:5.5.37-1.el7_0
  mariadb-devel.x86_64 1:5.5.37-1.el7_0                  mariadb-embedded.x86_64 1:5.5.37-1.el7_0
  mariadb-embedded-devel.x86_64 1:5.5.37-1.el7_0         mariadb-libs.x86_64 1:5.5.37-1.el7_0
  mariadb-server.x86_64 1:5.5.37-1.el7_0                 mariadb-test.x86_64 1:5.5.37-1.el7_0

Dependency Installed:
  perl-DBD-MySQL.x86_64 0:4.023-5.el7

Complete!
[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.servi                     
ce'
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> logout
    -> exit
    ->
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaD                     
B server version for the right syntax to use near 'logout
exit' at line 1
MariaDB [(none)]> exit
Bye
[root@localhost ~]# systemctl enable mariadb.service
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> use test
Database changed
MariaDB [test]> show tables;
Empty set (0.00 sec)

MariaDB [test]> exit
Bye
[root@localhost ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| zbphp.com 		 |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]>
登入後複製
文章 by default7#zbphp.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

Win11系統無法安裝中文語言套件的解決方法 Win11系統無法安裝中文語言套件的解決方法 Mar 09, 2024 am 09:48 AM

Win11系統無法安裝中文語言包的解決方法隨著Windows11系統的推出,許多用戶開始升級他們的作業系統以體驗新的功能和介面。然而,一些用戶在升級後發現他們無法安裝中文語言包,這給他們的使用體驗帶來了困擾。在本文中,我們將探討Win11系統無法安裝中文語言套件的原因,並提供一些解決方法,幫助使用者解決這個問題。原因分析首先,讓我們來分析一下Win11系統無法

無法在VirtualBox中安裝來賓添加 無法在VirtualBox中安裝來賓添加 Mar 10, 2024 am 09:34 AM

您可能無法在OracleVirtualBox中將來賓新增安裝到虛擬機器。當我們點擊Devices>InstallGuestAdditionsCDImage時,它只會拋出一個錯誤,如下所示:VirtualBox-錯誤:無法插入虛擬光碟C:將FilesOracleVirtualBoxVBoxGuestAdditions.iso編程到ubuntu機器中在這篇文章中,我們將了解當您無法在VirtualBox中安裝來賓新增元件時該怎麼辦。無法在VirtualBox中安裝來賓添加如果您無法在Virtua

如何在Windows 11/10中執行SUDO命令 如何在Windows 11/10中執行SUDO命令 Mar 09, 2024 am 09:50 AM

透過sudo指令,使用者可以在提升權限模式下執行指令,而無需切換到超級使用者模式。本文將介紹如何在Windows系統中模擬類似sudo指令的功能。什麼是數道司令部? Sudo(「超級使用者do」的縮寫)是一種命令列工具,允許基於Unix的作業系統(如Linux和MacOS)的使用者以提升的權限執行命令,這些權限通常是管理員所擁有的。在Windows11/10中執行SUDO命令然而,隨著最新發布的Windows11Insider預覽版推出,Windows用戶現在也可以體驗到這項功能。這項新功能使用戶能夠

百度網盤下載成功但是安裝不了怎麼辦? 百度網盤下載成功但是安裝不了怎麼辦? Mar 13, 2024 pm 10:22 PM

如果你已經成功下載了百度網盤的安裝文件,但是無法正常安裝,可能是軟體文件的完整性發生了錯誤或者​​是殘留文件和註冊表項的問題,下面就讓本站來為用戶們來仔細的介紹一下百度網盤下載成功但是安裝不了問題解析吧。  百度網盤下載成功但是安裝不了問題解析  1、檢查安裝檔完整性:確保下載的安裝檔完整且沒有損壞。你可以重新下載一次,或者嘗試使用其他可信任的來源下載安裝檔。  2、關閉防毒軟體和防火牆:某些防毒軟體或防火牆程式可能會阻止安裝程式的正常運作。嘗試將防毒軟體和防火牆停用或退出,然後重新執行安裝

如何在Linux上安裝安卓應用程式? 如何在Linux上安裝安卓應用程式? Mar 19, 2024 am 11:15 AM

在Linux上安裝安卓應用程式一直是許多用戶所關心的問題,尤其是對於喜歡使用安卓應用程式的Linux用戶來說,掌握如何在Linux系統上安裝安卓應用程式是非常重要的。雖然在Linux系統上直接運行安卓應用程式並不像在Android平台上那麼簡單,但是透過使用模擬器或第三方工具,我們依然可以在Linux上愉快地享受安卓應用程式的樂趣。以下將為大家介紹在Linux系統上安裝安卓應

如何在Ubuntu 24.04上安裝Podman 如何在Ubuntu 24.04上安裝Podman Mar 22, 2024 am 11:26 AM

如果您使用過Docker,則必須了解守護程式、容器及其功能。守護程序是在容器已在任何系統中使用時在背景執行的服務。 Podman是一個免費的管理工具,用於管理和建立容器,而不依賴任何守護程序,例如Docker。因此,它在管理貨櫃方面具有優勢,而不需要長期的後台服務。此外,Podman不需要使用根級別的權限。本指南詳細討論如何在Ubuntu24上安裝Podman。更新系統我們先進行系統更新,開啟Ubuntu24的Terminalshell。在安裝和升級過程中,我們都需要使用命令列。一種簡單的

win11小元件怎麼刪除? 一條指令卸載 Windows11小元件功能技巧 win11小元件怎麼刪除? 一條指令卸載 Windows11小元件功能技巧 Apr 11, 2024 pm 05:19 PM

小組件是Win11系統的新增功能,預設是開啟狀態,但是難免會出現有部分用戶不太使用到小組件,看著佔位置,因此想要禁用小組件的情況,那麼應該如何操作呢?下面小編就教大家操作方法,大家可以去試試看。什麼是小組件?小元件是小卡片,用於在Windows桌面上顯示你最喜愛的應用程式和服務中的動態內容。它們顯示在小組件板上,你可以在其中發現、固定、取消固定、排列、調整大小和自訂小組件以反映你的興趣。小組件板經過最佳化,可根據使用情況顯示相關小組件和個人化內容。從工作列的左角開啟小組件板,可在其中看到即時天氣

在Ubuntu 24.04上安裝和執行Ubuntu筆記應用程式的方法 在Ubuntu 24.04上安裝和執行Ubuntu筆記應用程式的方法 Mar 22, 2024 pm 04:40 PM

在高中學習的時候,有些學生做的筆記非常清晰準確,比同一個班級的其他人都做得更多。對某些人來說,記筆記是一種愛好,而對其他人來說,當他們很容易忘記任何重要事情的小資訊時,則是一種必需品。 Microsoft的NTFS應用程式對於那些希望保存常規講座以外的重要筆記的學生特別有用。在這篇文章中,我們將描述Ubuntu24上的Ubuntu應用程式的安裝。更新Ubuntu系統在安裝Ubuntu安裝程式之前,在Ubuntu24上我們需要確保新設定的系統已經更新。我們可以使用Ubuntu系統中最著名的「a

See all articles