MYSQL binary installation + XFS, mysqlxfs

Source: Internet
Author: User

MYSQL binary installation + XFS, mysqlxfs
1. Prepare partitions
Yum install xfsprogs
[Root @ ycdatadbsupport 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
[Root @ ycdatadbsupport yum. repos. d] # mkdir/data
[Root @ ycdatadbsupport yum. repos. d] # mount-o rw, noatime, nodiratime, noikeep, nobarrier, allocsize = 100 M, attr2, largeio, inode64, swalloc/dev/sdb/data
[Root @ ycdatadbsupport 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 264 K 2.0G 1%/dev/shm
/Dev/sda1 485 M 59 M 401 M 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 33 M 30G 1%/data
[Root @ ycdatadbsupport yum. repos. d] # vi/etc/fstab




#
#/Etc/fstab
# Created by anaconda on Fri May 23 22:30:35 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info
#
/Dev/mapper/VolGroup-lv_root/ext4 ults 1 1
UUID = 181e768c-89a3-4e65-b576-4f9ae746f642/boot ext4 defaults 1 2
/Dev/mapper/VolGroup-lv_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 defaults 0 0
/Dev/sdb/data xfs rw, noatime, nodiratime, noikeep, nobarrier, allocsize = 100 M, attr2, largeio, inode64, swalloc 0 0


2. Prepare the directory:
[Root @ ycdatadbsupport yum. repos. d] # mkdir-p/data/mysql/mysql_3306/data
[Root @ ycdatadbsupport yum. repos. d] # mkdir-p/data/mysql/mysql_3306/tmp
[Root @ ycdatadbsupport yum. repos. d] # mkdir-p/data/mysql/mysql_3306/logs
[Root @ ycdatadbsupport yum. repos. d] # chown-R root: mysql/data
[Root @ ycdatadbsupport yum. repos. d] # chown-R mysql: mysql/data
[Root @ ycdatadbsupport yum. repos. d] # chmod-r 775/data


3. Decompress MYSQL software
Tar-xzvf mysql-5.5.37-linux2.6-x86_64.tar.gz


4. Complete soft links
[Root @ ycdatadbsupport 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 the database
[Root @ ycdatadbsupport 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 have 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 have no effect if -- log_slow_queries is not set
OK


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


Please remember to set a password for the MySQL root USER!
To do 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 will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon:
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


Please report any problems at http://bugs.mysql.com/


7. Start the database
[Root @ ycdatadbsupport local] # mysqld_safe -- defaults-file =/etc/my. cnf &
[1] 7666
[Root @ ycdatadbsupport 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 to MSYQL and change the ROOT password. No Password is required for the first login. In this way, MYSQL is successfully installed.
[Root @ ycdatadbsupport 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) 2000,201 4, Oracle and/or its affiliates. All rights reserved.


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


Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.


(Testing) root @ ycdatadbsupport [(none)]> grant all privileges on *. * TO root @ "%" identified by "vipshop ";
Query OK, 0 rows affected (0.00 sec)




(Testing) root @ ycdatadbsupport [(none)]> use mysql;
Database changed
(Testing) root @ ycdatadbsupport [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) root @ ycdatadbsupport [mysql]> commit;
Query OK, 0 rows affected (0.00 sec)


(Testing) root @ ycdatadbsupport [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)


(Testing) root @ ycdatadbsupport [mysql]> exit
Bye
[Root @ ycdatadbsupport 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) 2000,201 4, Oracle and/or its affiliates. All rights reserved.


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


Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.


(Testing) root @ ycdatadbsupport [(none)]>

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.