CentOS6 Offline RPM Installation MariaDB10

Source: Internet
Author: User
Tags create directory

Reprint please save the original link: http://www.wlm.so/Article/Detail/lmb4cijci5mc900000

1. Uninstall the original MySQL installation package to avoid installation file conflicts

#查找所有的mysql包rpm-qa|grep-i MySQL    #卸载包, XXXXXXX replaced the found MySQL package rpm-e--nodeps XXXXXXX  

2. Download the installation package, unzip it, upload it to the CentOS6 system, and place it in the root directory.


3. Enter the following command to complete the installation.

RPM-IVH LIBAIO-0.3.107-10.EL6.X86_64.RPMRPM-IVH LIBTOOL-LTDL-2.2.6-15.5.EL6.X86_64.RPMRPM-IVH UNIXODBC-2.2.14-14.EL6.X86_64.RPMRPM-IVH JUDY-1.0.5-5.1.X86_64.RPMRPM-IVH perl-libs-5.10.1-136.el6.x86_64.rpm perl-pod-escapes-1.04-136.el6.x86_64.rpm perl-module-pluggable-3.90-136.el6.x86_64.rpm perl-5.10.1-136.el6.x86_ 64.rpm perl-pod-simple-3.13-136.el6.x86_64.rpm PERL-VERSION-0.77-136.EL6.X86_64.RPMRPM-IVH perl-dbi-1.609-4.el6.x86_64.rpm PERL-TIME-HIRES-1.9721-136.EL6.X86_64.RPMRPM-IVH MariaDB-10.0.15-centos6-x86_64- common.rpm MARIADB-10.0.15-CENTOS6-X86_64-COMPAT.RPMRPM-IVH MARIADB-10.0.15-CENTOS6-X86_64-CLIENT.RPMRPM-IVH mariadb-10.0.15-centos6-x86_64-server.rpm


4. Start the service.
# view MySQL status; Close database  # service MySQL status  # service MySQL stop  # start database  service MySQL start  

5. Change the root password

#  Change root password  mysqladmin-u root password ' 123456 '  


6. Log in to the database



This machine uses the command above to log in. If it is another machine, it can be in the following form:


7. Log in after MySQL test
--Check the state status of MySQL  ;  -Display supported engine show  engines;  --Show all databases show  databases;  --Toggles the database context, which sets the default database use test for the current session  ;  -Show all tables in this database show  tables;  --Create a table  t_test (    ID int (one) UNSIGNED not NULL auto_increment,    userId Char,    Lastlogintime timestamp,   PRIMARY KEY (ID)  ) engine=innodb DEFAULT Charset=utf8;    --Inserting test data insert into  t_test (userId)      values  (' admin ')  , (' haha ')  ;   --Simple Query  select * from T_test;  Select Id,userid from T_test  where userid= ' admin ';  


8. Configure Remote Access
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT option;flush privileges;

Description: Root is the user logging into the database, 123456 is the password to log in the database, * means that any source of any host, anyway, is the right to a large appearance.

9. Modify the data storage directory

MySQL, MariaDB's default data is stored in the/var/lib/mysql/directory, if you do not want to put it here, or if you want the program and data separation, or disk reasons, you need to switch to other paths, you can modify the DataDir system variables to achieve the purpose.
# Stop Database  service MySQL stop   # Create directory, assuming no words  mkdir/usr/local/ieternal/mysql_data    # Copy default database to new location  #-A The command is to copy the file attributes together, otherwise various problems  cp-a/var/lib/mysql/usr/local/ieternal/mysql_data    # Back up the original data  cp-a/etc/my.cnf/etc/ My.cnf_original    # In fact, viewing the/etc/my.cnf file can be found  in the # MariaDB this file only contains a statement # so need to modify the configuration file for/etc/my.cnf.d/server.cnf  cp/etc/my.cnf.d/server.cnf/etc/my.cnf.d/server.cnf_original  vi/etc/my.cnf.d/server.cnf  

Then press I to enter edit mode, you can insert the relevant content. Use the upper and lower keys of the keyboard to move the cursor, after editing is complete, press ESC to exit edit mode (enter command mode), and then enter the command: Wq Save and exit

# Add content to the Mysqld section of the file    [mysqld]  datadir=/usr/local/ieternal/mysql_data/mysql  socket=/var/lib/mysql/ Mysql.sock  #default-character-set=utf8  character_set_server=utf8  slow_query_log=on  slow_query_ Log_file=/usr/local/ieternal/mysql_data/slow_query_log.log  long_query_time=2  

Among them, only datadir and sockets are more important; And Default-character-set is MySQL himself know, and mariadb don't know, equivalent to become character_set_server

CentOS6 Offline RPM Installation MariaDB10

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.