Centos7 the correct command to install MARIADB

Source: Internet
Author: User

Using the Linode CENTOS7 system, the installation of MySQL found that the default is MARIADB.

However, whether the use of Linode official website or Baidu search to the basic installation method can not be installed successfully.

Always prompt this sentence:

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



Finally, Google search for install MARIADB on CentOS 7 has been a critical step in the installation.

Now that the installation is successful, please note the entire installation process:

Mysql:[[email protected] ~]# yum-y install mariadb*loaded plugins:fastestmirrorloading mirror speeds from cached ho Stfile * base:mirrors.linode.com * extras:mirrors.linode.com * updates:mirrors.linode.comResolving dependencies--> Running Transaction Check---> Package mariadb.x86_64 1:5.5.37-1.el7_0 'll be installed---> package Mariadb-bench.x86_64 1:5.5.37-1.el7_0 'll be installed---> Package mariadb-devel.x86_64 1:5.5.37-1.el7_0 'll be Installed---> Package mariadb-embedded.x86_64 1:5.5.37-1.el7_0 'll be a installed---> package Mariadb-embedded-devel.x86_64 1:5.5.37-1.el7_0 'll be installed---> Package mariadb-libs.x86_64 1:5.5.37-1.el7_0 'll be installed---> Package mariadb-server.x86_64 1:5.5.37-1.el7_0 'll be installed--> processing dependency:pe Rl-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 'll be installed--> Running transaction Check---> Package perl-dbd-mysql.x86_64 0:4.023-5.el7 'll be installed--> finished Dependency resolutiondependencies resolved====================== ==================================================================================== Package ARC H Version Repository size======================================================= ===================================================INSTALLING:MARIADB x86_64 1:5.5.3            7-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 Maria                      Db-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 One M mariadb-test x86_64 1:5.5.37-1.el7_0 UPDA                 TES 7.9 minstalling for Dependencies:perl-dbd-mysql x86_64 4.023-5.EL7 Base Ktransaction summary======================================================================== ==================================install 8 Packages (+1 Dependent package) Total download size:40 minstalled 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 | One 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 | 00:00:00 KB-------------------------------------------------------------------------------------------------  ---------Total | mb/s | 00:00:01running transaction checkrunning Transaction testtransaction test succeededrunning transaction installing : 1:mariadb-libs-5.5.37-1.el7_0.x86_64 1/9 installing:1:mariadb-5.5.3        7-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_6                                                   4 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:mari adb-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/9i nstalled: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.e L7_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_0Depe Ndency installed:perl-dbd-mysql.x86_64 0:4.023-5.el7complete! [[email protected] ~]# systemctl start mariadb.service[[email protected] ~]# systemctl Enable Mariadb.serviceln-s '/usr/lib/systemd/system/mariadb.service '/etc/systemd/system/multi-user.target.wants/  Mariadb.servi CE ' [[email protected] ~]# mysqlwelcome to the MARIADB Monitor. Commands End With; MariaDB Connection ID is 2Server version:5.5.37-mariadb MariaDB servercopyright (c) \g.your, Oracle, Monty Program Ab and others. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. MariaDB [(None)]> logout, exit, and so on; Error 1064 (42000): You have a error in your SQL syntax; Check the manual-corresponds to your mariad B-server version for the right-syntax-use-near ' lo Goutexit ' at line 1MariaDB [(None)]> exitbye[[email protected] ~]# systemctl enable mariadb.service[[email protected] ~]#  Mysqlwelcome to the MariaDB Monitor. Commands End With; MariaDB Connection ID is 3Server version:5.5.37-mariadb MariaDB servercopyright (c) \g.your, 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 Testdatabase changedmariadb [te St]> Show tables; Empty Set (0.00 sec) MariaDB [test]> exitbye[[email protected] ~]# mysql_secure_installation/usr/bin/mysql_ Secure_installation:line 379:find_mysql_client:command not foundnote:running all PARTS of this SCRIPT is RECOMMENDED F  OR all MariaDB SERVERS in PRODUCTION use! Please READ each STEP carefully!  In order to log into MariaDB to secure it, we'll need the CurrentPassword for the root user. If you ' ve just installed MariaDB, Andyou Haven ' t set the root password yet, the password would be a 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 Mariadbroot user without the proper authorisation. Set root Password? [y/n] ynew password:re-enter new Password:password updated successfully! Reloading privilege tables. ... success!  By default, a MariaDB installation had an anonymous user, allowing Anyoneto log into MariaDB without had to had a user  Account created Forthem.  This was intended only for testing, and the Installationgo a bit smoother. You should remove them before moving into aproduction environment. Remove Anonymous Users? [y/n] Y ... success!  Normally, Root should only is allowed to connect from ' localhost '. Thisensures that someone cannot guess at the root of password from the network. Disallow Root login remotely? [y/n] Y ... success!  By default, the MariaDB comes with a database named ' Test ' anyone canaccess. This was also intended only for testing, and should was removedbefore 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 would ensure that all changes made so farwill 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 mariadbinstallation should now is secure. Thanks for using mariadb!  [[email protected] ~]# mysql-uroot-penter password:welcome to the MariaDB Monitor. Commands End With; or \g.your MariaDB connection ID is 15Server version:5.5.37-MARIADB MariaDB Servercopyright (c)., 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)]>

Article by default7#zbphp.com


Centos7 the correct command to install MARIADB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.