Installation steps for the MARIADB database in MAC __ Database

Source: Internet
Author: User
Tags install homebrew
We all know that MARIADB database management system is a branch of MySQL, mainly by the open source community in the maintenance, the use of GPL licensing MARIADB is fully compatible with MySQL, including APIs and command line, so that it can easily become a replacement for MySQL. In this article we will detail the steps to install the MARIADB database in the Mac, and need to refer to learning.

Preface

MARIADB was developed by MySQL founder Michael Widenius, who sold his company MySQL to Sun for 1 billion dollars earlier, and then, as Sun was bought by Oracle, the ownership of MySQL fell into Oracle's hands. The name of MARIADB is from the name of Michael Widenius's daughter Maria. So how do you install the MARIADB database in the Mac? The following small series for you to introduce the MAC installation configuration Mariadb database method.

mariadb Installation Steps

If you are a Mac developer, through this article you can simply get the mariadb to install the latest stable version via homebrew on OS X, and then we will guide the installation of the MARIADB database step-by-step. If you have Xcode and homebrew installed on your Mac, skip to step fourth.

1. Install Xcode

Use the following command to install the Xcode:

2. Install Homebrew

To install the Homebrew command:

Ruby-e "$ (curl-fssl https://raw.github.com/Homebrew/homebrew/go/install)"

3. Check Homebrew

4. Update Homebrew

If you check that homebrew is not the latest version through the above command, you can update the homebrew to the latest by using the following command:

5. Confirm the MARIADB version

Confirm the version of MARIADB in the Homebrew warehouse:

6. Install mariadb

Download the installation mariadb with the following command:

7. Run the Database Setup program

Implement the installation separately by executing the following command:

unset tmpdir 
cd/usr/local/cellar/mariadb/10.0.10/ 

8. Run MARIADB

After some of the above commands, the MARIADB database has been installed, but the MARIADB database service is not started and you can start the MARIADB database service by this command:

9. Complete the installation safely

By starting the MARIADB database service above, you can already connect to the MARIADB database, but it is not safe enough to complete the setup by resetting the root password, removing the anonymous user, removing the default test database, and so on.

The specific implementation and settings are as follows:

➜10.1.14:mysql_secure_installation note:running All PARTS The This SCRIPT is recommended to 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'll be blank, so you should J

UST Press ENTER here. Enter current password for root (enter to none): ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using PA Ssword:yes) Enter Current password for root (Enter to None): ERROR 1045 (28000): Access denied for user ' root ' @ ' Localh Ost ' (using Password:yes) Enter current password for root (enter to none): OK, successfully used password, moving on..

.

Setting The root password ensures that nobody can log into the mariadb root user without the proper. 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 of anonymous user, allowing anyone to log into mariadb without have to have a US Er account created for them. This is intended only for testing, and to make the installation go a bit smoother.

You are should remove them before moving into a production environment. Remove anonymous users? [y/n] Y...

success! Normally, Root should only is allowed to connect from ' localhost '.

This ensures is someone cannot guess at the root password from the network. Disallow root login remotely?

[y/n] n ... skipping. By default, MARIADB comes with a database named ' Test ' anyone can access.

This is also intended only for testing, and should are removed before into a moving production. 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 far would take effect immediately. Reload privilege tables now? [y/n] Y...

success!

Cleaning up ... All done!

If you have ' ve completed all of the the above steps, your MARIADB installation should now is secure.  The for using mariadb!

10. Connecting MARIADB data

To connect the MARIADB Database command:

11. Verify MARIADB version

MARIADB [(None)]> select @ @version; 
+-----------------+
| @ @version  |
+-----------------+
| 10.1.14-mariadb |
+-----------------+

mariadb Base Command

The following are some of the basic use commands for MARIADB:

--Display database list show
databases;

--Switch to the database named MySQL, display the data table in the library use
MySQL; 
Show tables;

--Displays the structure of the datasheet table
desc table;

--Build database A and delete database a
create db ' database_a '; 
Drop database ' database_a ';

--Build table: Use
database_a; 
CREATE TABLE table_a (field list); 
drop table table_a;

--Displays the records in the table:
select * from Table_a;

--Clear the record in the table:

Summary

The above is all the steps to install the MARIADB database in the Mac, everyone has learned it. Hope that the content of this article for everyone's learning can help, if there are questions you can message exchange.

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.