MYSQL Binary Installation +xfs

Source: Internet
Author: User
Tags reserved

1. Preparing partitions
Yum Install Xfsprogs
[Email protected] yum.repos.d]# mkfs.xfs-f-i attr=2-l lazy-count=1,sectsize=4096-b size=4096-d sectsize=4096-l data /dev/sdb
Meta-data=/dev/sdb isize=256 agcount=4, agsize=1966080 blks
= sectsz=4096 attr=2
data = bsize=4096 blocks=7864320, imaxpct=25
= Sunit=0 swidth=0 blks
Naming =version 2 bsize=4096 ascii-ci=0
Log =internal log bsize=4096 blocks=3840, version=2
= sectsz=4096 Sunit=1 Blks, lazy-count=1
Realtime =none extsz=4096 blocks=0, rtextents=0
[Email protected] yum.repos.d]# Mkdir/data
[Email protected] yum.repos.d]# Mount-o Rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100m,attr2,largeio, Inode64,swalloc/dev/sdb/data
[Email protected] yum.repos.d]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/volgroup-lv_root
36G 4.0G 30G 12%/
Tmpfs 2.0G 264K 2.0G 1%/DEV/SHM
/DEV/SDA1 485M 59M 401M 13%/boot
/dev/sr0 3.5G 3.5G 0 100%/media/ol6.3 x86_64 Disc 1 20120626
/dev/sr0 3.5G 3.5G 0 100%/mnt
/dev/sdb 30G 33M 30G 1%/data
[Email protected] yum.repos.d]# Vi/etc/fstab




#
#/etc/fstab
# Created by Anaconda on Fri 23 22:30:35 2014
#
# Accessible filesystems, by reference, is maintained under '/dev/disk '
# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info
#
/DEV/MAPPER/VOLGROUP-LV_ROOT/EXT4 Defaults 1 1
Uuid=181e768c-89a3-4e65-b576-4f9ae746f642/boot EXT4 Defaults 1 2
/dev/mapper/volgroup-lv_swap swap swap defaults 0 0
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
/dev/sdb/data XFS Rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100m,attr2,largei O,inode64,swalloc 0 0


2. Prepare the catalogue:
[Email protected] yum.repos.d]# mkdir-p/data/mysql/mysql_3306/data
[Email protected] yum.repos.d]# mkdir-p/data/mysql/mysql_3306/tmp
[Email protected] yum.repos.d]# mkdir-p/data/mysql/mysql_3306/logs
[Email protected] yum.repos.d]# chown-r root:mysql/data
[Email protected] yum.repos.d]# chown-r mysql:mysql/data
[Email protected] yum.repos.d]# chmod-r 775/data


3. Unzip the MySQL software
TAR-XZVF mysql-5.5.37-linux2.6-x86_64.tar.gz


4. Do a soft link
[Email protected] opt]# ln-s/opt/mysql-5.5.37-linux2.6-x86_64/usr/local/mysql


5. Prepare the initialization file:
Vi/etc/my.cnf


6. Initialize DB
[Email protected] mysql5]# scripts/mysql_install_db--defaults-file=/etc/my.cnf--user=mysql
Installing MySQL system tables ...
140612 13:51:56 [Warning] Options--log-slow-admin-statements,--log-queries-not-using-indexes and-- Log-slow-slave-statements has no effect if--log_slow_queries is not set
Ok
Filling Help Tables ...
140612 13:51:56 [Warning] Options--log-slow-admin-statements,--log-queries-not-using-indexes and-- Log-slow-slave-statements has no effect if--log_slow_queries is not set
Ok


To start mysqld at boot time with to copy
Support-files/mysql.server to the right place for your system


REMEMBER to SET A PASSWORD for the MySQL root USER!
To does so, start the server, then issue the following commands:


/usr/local/mysql5//bin/mysqladmin-u root password ' new-password '
/usr/local/mysql5//bin/mysqladmin-u root-h ycdatadbsupport.localdomain password ' new-password '


Alternatively you can run:
/usr/local/mysql5//bin/mysql_secure_installation


Which would also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.


See the Manual for more instructions.


You can start the MySQL daemon with:
cd/usr/local/mysql5/; /usr/local/mysql5//bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl
Cd/usr/local/mysql5//mysql-test; Perl mysql-test-run.pl


Problems at http://bugs.mysql.com/


7. Start the database
[Email protected] local]# Mysqld_safe--defaults-file=/etc/my.cnf &
[1] 7666
[Email protected] local]# 140612 14:46:33 mysqld_safe Logging to '/data/mysql/mysql_3306/data/error.log '.
140612 14:46:33 Mysqld_safe starting mysqld daemon with databases From/data/mysql/mysql_3306/data




8. Connect the msyql and change the root password. A password is not required for the first login. This will make the MySQL installation successful.
[Email protected] local]# mysql-uroot-p-s/tmp/mysql.sock
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server Version:5.5.37-log MySQL Community Server (GPL)


Copyright (c), the Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.


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


(testing) [Email protected] [(None)]> GRANT all privileges on * * to [e-mail protected] "%" identified by "Vipshop";
Query OK, 0 rows Affected (0.00 sec)




(testing) [Email protected] [(none)]> use MySQL;
Database changed
(testing) [Email protected] [mysql]> Update user Set password = password (' vipshop ') where user= ' root ';
Query OK, 4 rows affected (0.01 sec)
Rows Matched:5 Changed:4 warnings:0


(testing) [Email protected] [mysql]> commit;
Query OK, 0 rows Affected (0.00 sec)


(testing) [Email protected] [mysql]> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)


(testing) [Email protected] [mysql]> exit
Bye
[Email protected] local]# mysql-uroot-p-s/tmp/mysql.sock
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server Version:5.5.37-log MySQL Community Server (GPL)


Copyright (c), the Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.


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


(testing) [Email protected] [(None)]>

MYSQL Binary Installation +xfs

Related Article

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.