"Ubuntu 16.04.3 LTS" Apt-get installation mariadb

Source: Internet
Author: User
Tags mysql free percona percona server

First, MySQL background information
MySQL became popular in the early days of the Internet, pursuing speed, simplicity, open source, and support for almost all operating systems. Fully support multi-user, multi-threading, support massive data storage, using MyISAM, InnoDB two big storage engine complement each other. But with InnoDB and MySQL itself being acquired by Oracle, the founder of MySQL has developed mariadb.
MARIADB's biggest feature is the use of XTRADB storage engine, and compatible with the original version, keeping MySQL free and open, XTRADB is a high-performance storage engine developed by Percona, The main purpose is to replace the InnoDB. In addition to the XTRADB engine, the rising star Tokudb supports high performance, transactional storage engines with much higher performance than InnoDB, high insert performance, high compression ratios, support for modifying indexes online, and adding fields.
MySQL, MariaDB, Percona Server cannot coexist during installation, and you must uninstall the other two to deploy the MariaDB. Otherwise, the "MySQL service masked" error occurs.
Second, installation mariadb
1. Installing the database environment

    1. [Email protected]:~$ sudo aptitude install-y mariadb-server mariadb-client

2. Installing the DB instance

    1. [Email protected]:~$ sudo mysql_secure_installation
  1. Note:running all PARTS of this SCRIPT are RECOMMENDED for all MariaDB
  2. SERVERS in PRODUCTION use! Please READ each STEP carefully!
  3. In order to log into MariaDB to secure it, we'll need the current
  4. Password for the root user. If you ' ve just installed MariaDB, and
  5. You haven ' t set the root password yet, the password would be blank,
  6. So, should just press ENTER here.
  7. Enter current password to root (enter for none): Set Root password 1
  8. OK, successfully used password, moving on ...
  9. Setting The root password ensures that nobody can log into the MariaDB
  10. Root user without the proper authorisation.
  11. You already has a root password set so that you can safely answer ' n '.
  12. Change the root password? [y/n] n Change Password: n does not change
  13. ... skipping.
  14. By default, a MariaDB installation have an anonymous user, allowing anyone
  15. To log into MariaDB without has to has a user account created for
  16. them. This was intended only for testing, and the installation
  17. Go a bit smoother. You should remove them before moving into a
  18. Production environment.
  19. Remove anonymous users? [y/n] y remove test User: Y Yes
  20. ... success!
  21. Normally, Root should only is allowed to connect from ' localhost '. This
  22. Ensures that someone cannot guess at the root of password from the network.
  23. Disallow Root login remotely? [y/n] Y allows root telnet: N not allowed
  24. ... success!
  25. By default, MariaDB comes with a database named ' test ' that anyone can
  26. Access. This was also intended only for testing, and should be removed
  27. Before moving into a production environment.
  28. Remove test database and access to it? [y/n] Y Erase test Database test:y Delete
  29. -Dropping test database ...
  30. ... success!
  31. -Removing privileges on test database ...
  32. ... success!
  33. Reloading the privilege tables would ensure that all changes made so far
  34. would take effect immediately.
  35. Reload privilege tables now? [y/n] Y reload permission table: Y Reload
  36. ... success!
  37. Cleaning up ...
  38. All done! If you ' ve completed all of the above steps, your MariaDB
  39. Installation should now is secure.
  40. Thanks for using MariaDB

3. View the status of the MARIADB database service (It also shows that mariadb and other MySQL databases cannot coexist on the same operating system)

    1. [Email protected]:~$ sudo systemctl status MySQL

4. Start the MARIADB database service

    1. [Email protected]:~$ sudo systemctl start MySQL

3. Set up MySQL to boot with system service

    1. [email protected]:~$ sudo update-rc.d mysql defaults

4. Revoke the boot with system service

    1. [email protected]:~$ sudo update-rc.d-f mysql remove

5. Unlike the previous version of MySQL, you need to gain operating system administrator privileges to log on to mariadb root user, normal operating system users cannot log on to the MARIADB database root user

    1. [Email protected]:~$ sudo mysql-u root-p

6. Backing up the MySQL database also requires an operating system administrator to perform the backup

    1. [email protected]:~$ sudo mysqldump-uroot-p mysql >mysql.sql

7. Create a normal database user ( login to normal database users do not need to gain operating system administrator privileges)

    1. Create user ' ZHANGDC ' @'% ' identified by ' 1 '; (The following number is the password can be set by itself)

8. Log in to remote database (requires [email protected] '% ')

    1. [Email protected]:~$ mysql-h localhost-u HENRY-P1

9. Modify the MARIADB configuration file and monitor the extranet access

    1. [Email protected]:~$ sudo vim/etc/mysql/mariadb.conf.d/50-server.cnf

# Instead of skip-networking The default is now-listen only on
# localhost which are more compatible and are not less secure.
#bind-address = 127.0.0.1 #注释掉这一行

10. Restart the database service for the configuration to take effect

    1. [Email protected]:~$ sudo systemctl restart MySQL

Version 11.MariaDB

      1. [Email protected]:~$ mysql-v
      2. MySQL Ver 15.1 distrib 10.0.29-mariadb, for Debian-linux-gnu (x86_64) using ReadLine 5.2

"Ubuntu 16.04.3 LTS" Apt-get installation 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.