Install MySQL 5.6.22 under CentOS 6.4

Source: Internet
Author: User
Tags crc32 deprecated mysql in mysql version

This article details the process of installing MySQL 5.6.22 under CentOS 6.4 for the needs of friends to learn the reference.

One, download MySQL installation package

1) http://dev.mysql.com/downloads/mysql/Open URL: Select Platform: Choose Linux-generic Select linux-generic (glibc 2.5) (x86, 64-bit), RPM for download;Download under Linux: wget Http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar 2) After downloading and then unzip and put it in the installation folder: TAR-XF MYSQL-5.6.22-1.LINUX_GLIBC2.5.X86_64.RPM-BUNDLE.TARMV mysql-5.6.22-1.linux_ GLIBC2.5.X86_64.RPM-BUNDLE/USR/LOCAL/SOFTWARE/MV Mysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle MySQL in which to use is these two: MySQL database: Mysql-server-5.6.22-1.linux_glibc2.5.x86_64.rpmmysql client: Mysql-client-5.6.22-1.linux _GLIBC2.5.X86_64.RPM 3) Installation environment: Cat/etc/redhat-release CentOS Release 6.4 (Final) II, MySQL installation 1) 3) Check the installation before installing MySQL, First check that the CentOS system has installed a MySQL, if installed first uninstall, otherwise it will cause the installation of new MySQL failure. Rpm-qa | grep MySQL--check to see if MySQL was installed before the system.

mysql-libs-5.1.47-4.el6.i686 display results show that the CentOS6.0 system comes with a MySQL, we need to delete this old version, execute the following statement with the root user

Su-Password:
RPM-E--nodeps mysql-libs-5.1.47-4.el6.i686
First switch to the "root" user, and then execute the DELETE statement, after deletion, we look again, found that the CentOS6.0 has been successfully removed from the old MySQL version. After removing the MySQL rpm, there are some cleanup operations, there are two types of operations on the web. (Note: I do not use either of these, and found that there is no other residual MySQL information in the system.) The first type of aftercare: Use the command below to process it. rm-rf/var/lib/mysql*rm-rf/usr/share/mysql* Another treatment: the/ETC/MY.CNF in/var/lib/mysql after uninstallation is renamed to my.cnf.rpmsave,/var/log/ Mysqld.log will be renamed to/var/log/mysqld.log.rpmsave, and if determined, it will be deleted manually. 2) Install MySQL server RPM-IVH mysql-server-5.6.22-1.linux_glibc2.5.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-server ########################################### [100%]
Warning:user MySQL does not exist-using root
Warning:group MySQL does not exist-using root
2014-08-10 22:43:44 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-10 22:43:44 23012 [Note] innodb:using Atomics to ref count buffer pool pages
2014-08-10 22:43:44 23012 [Note] innodb:the InnoDB memory heap is disabled
2014-08-10 22:43:44 23012 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-08-10 22:43:44 23012 [Note] innodb:memory barrier is not used
2014-08-10 22:43:44 23012 [Note] innodb:compressed tables use zlib 1.2.3
2014-08-10 22:43:44 23012 [Note] innodb:using Linux native AIO
2014-08-10 22:43:44 23012 [Note] innodb:not using CPU CRC32 instructions
2014-08-10 22:43:44 23012 [Note] innodb:initializing buffer pool, size = 128.0M
2014-08-10 22:43:44 23012 [Note] innodb:completed initialization of buffer pool
2014-08-10 22:43:45 23012 [Note] innodb:the first specified data file./ibdata1 did not exist:a new database to be creat ed!
2014-08-10 22:43:45 23012 [Note] innodb:setting file./ibdata1 size to MB
2014-08-10 22:43:45 23012 [Note] Innodb:database physically writes the file full:wait ...
2014-08-10 22:43:45 23012 [Note] innodb:setting log file./ib_logfile101 size to + MB
2014-08-10 22:43:46 23012 [Note] innodb:setting log file./ib_logfile1 size to + MB
2014-08-10 22:43:46 23012 [Note] innodb:renaming log file./ib_logfile101 to./ib_logfile0
2014-08-10 22:43:46 23012 [Warning] innodb:new log files created, lsn=45781
2014-08-10 22:43:46 23012 [Note] innodb:doublewrite buffer not found:creating new
2014-08-10 22:43:46 23012 [Note] Innodb:doublewrite buffer created
2014-08-10 22:43:46 23012 [Note] innodb:128 rollback segment (s) is active.
2014-08-10 22:43:46 23012 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2014-08-10 22:43:47 23012 [Note] innodb:foreign key constraint system tables created
2014-08-10 22:43:47 23012 [Note] innodb:creating tablespace and datafile system tables.
2014-08-10 22:43:47 23012 [Note] innodb:tablespace and datafile system tables created.
2014-08-10 22:43:47 23012 [Note] innodb:waiting for purge to start
2014-08-10 22:43:47 23012 [Note] innodb:5.6.22 started; Log sequence number 0
A random root password has been set. You'll find it in '/root/.mysql_secret '.
2014-08-10 22:43:48 23012 [Note] Binlog End
2014-08-10 22:43:48 23012 [Note] innodb:fts optimize thread exiting.
2014-08-10 22:43:48 23012 [Note] innodb:starting shutdown ...
2014-08-10 22:43:50 23012 [Note] Innodb:shutdown completed; Log sequence Number 1625977


2014-08-10 22:43:50 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-10 22:43:50 23039 [Note] innodb:using Atomics to ref count buffer pool pages
2014-08-10 22:43:50 23039 [Note] innodb:the InnoDB memory heap is disabled
2014-08-10 22:43:50 23039 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-08-10 22:43:50 23039 [Note] innodb:memory barrier is not used
2014-08-10 22:43:50 23039 [Note] innodb:compressed tables use zlib 1.2.3
2014-08-10 22:43:50 23039 [Note] innodb:using Linux native AIO
2014-08-10 22:43:50 23039 [Note] innodb:not using CPU CRC32 instructions
2014-08-10 22:43:50 23039 [Note] innodb:initializing buffer pool, size = 128.0M
2014-08-10 22:43:50 23039 [Note] innodb:completed initialization of buffer pool
2014-08-10 22:43:50 23039 [Note] innodb:highest supported file format is Barracuda.
2014-08-10 22:43:50 23039 [Note] innodb:128 rollback segment (s) is active.
2014-08-10 22:43:50 23039 [Note] innodb:waiting for purge to start
2014-08-10 22:43:50 23039 [Note] innodb:5.6.22 started; Log sequence Number 1625977
2014-08-10 22:43:50 23039 [Note] Binlog End
2014-08-10 22:43:50 23039 [Note] innodb:fts optimize thread exiting.
2014-08-10 22:43:50 23039 [Note] innodb:starting shutdown ...
2014-08-10 22:43:52 23039 [Note] Innodb:shutdown completed; Log sequence Number 1625987

A RANDOM PASSWORD have BEEN SET for the MySQL root USER!
You'll find that password in '/root/.mysql_secret '.

You must change this password on your first connect,
No other statement but ' SET PASSWORD ' would be accepted.
See the Manual for the semantics of the ' password expired ' flag.

Also, the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

Which would also give you the option of removing the test database.
This is the strongly recommended for production servers.

See the Manual for more instructions.

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

The latest information about MySQL was available on the Web at

Http://www.mysql.com

Support for MySQL by buying support/licenses at http://shop.mysql.com

New Default Config file was created as/usr/my.cnf and
Would be used by default by the server when you start it.
You could edit this file to the Change server settings

3) Detect if the MySQL 3306 port is open. Test success can run netstat see if the MySQL port is open, such as open indicates that the service has been started and the installation is successful. The default port for MySQL is 3306.
[[email protected]mysql]# Netstat-nat
Active Internet connections (servers and established)
Proto recv-q send-q Local address Foreign address state
TCP 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
TCP 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN
TCP 0 0 192.168.128.129:9000 0.0.0.0:* LISTEN
TCP 0 0 0.0.0.0:50090 0.0.0.0:* LISTEN
TCP 1 0 192.168.128.129:35744 63.130.76.64:80 close_wait
TCP 0 0 192.168.128.129:34847 192.168.128.129:9000 established
TCP 0 0 192.168.128.129:35770 192.168.128.129:9000 time_wait
TCP 0 192.168.128.129:22 192.168.128.1:1297 established
TCP 0 0 192.168.128.129:50968 61.135.185.247:80 established
TCP 0 0 192.168.128.129:9000 192.168.128.129:34847 established
TCP 0 0::: 34803:::* LISTEN
TCP 0 0::: $:::* LISTEN
TCP 0 0:: 1:631:::* LISTEN
TCP 0 0::: 8088:::* LISTEN
TCP 0 0::: 13562:::* LISTEN
TCP 0 0::: 8030:::* LISTEN
TCP 0 0::: 8031:::* LISTEN
TCP 0 0::: 8032:::* LISTEN
TCP 0 0::: 8033:::* LISTEN
TCP 0 0::: 8040:::* LISTEN
TCP 0 0::: 8042:::* LISTEN
TCP 0 0:: ffff:192.168.128.129:8031:: ffff:192.168.128.12:58051 established
TCP 0 0:: ffff:192.168.128.12:58051:: ffff:192.168.128.129:8031 established 4) Start MySQL service
[[email protected]mysql]# service MySQL Start
Starting MySQL .....  success! 5) Install the client
[[email protected] MYSQL]# RPM-IVH mysql-client-5.6.22-1.linux_glibc2.5.x86_64.rpmpreparing ...         & nbsp      ########################################### [100%]1:mysql-client           ^c########################################### [100%]   Installation complete  5) Several important directories of MySQL. MySQL installation is not as if SQL Server is installed by default in a directory, its database files, configuration files and command files in different directories, it is very important to understand these directories, especially for Linux beginners, because the Linux itself directory structure is more complex, If you don't know the MySQL installation directory then you can't talk about deep learning. A, database directory    /VAR/LIB/MYSQL/ B, configuration files    /usr/share/mysql (mysql.server command and configuration file)  c, related commands    /usr/bin (mysqladmin mysqldump and other commands)  d, startup scripts  /etc/rc.d/init.d/(startup script file mysql directory)   such as:/etc/ Rc.d/init.d/mysql start/restart/stop/status 6) Change the MySQL directory. Because the MySQL database directory occupies a large disk, and MySQL default data file storage directory is/"Var/lib/mysql", you can also move the data directory to the "/" root directory of "Mysql_data" directory (if you do not have to move the test).   Stop MySQL service process: service MySQL stop  or  mysqladmin-u root-p shutdownmysql Default user name "root", here "root" The most privileged user "root" with Linux is not a moment, and the defaultThe user "root" password is empty, so let enter the password, directly click Enter. Move the "/var/lib/mysql" entire directory to "/mysql_data" mv/var/lib/mysql/mysql_data  find the MY.CNF profile if there is no/etc/configuration file under the "my.cnf" directory, go to the "/ usr/share/mysql/"Find the my-default.cnf   file, copy one of the appropriate profiles to"/etc/"and rename it to" My.cnf ". The commands below:cp/usr/share/mysql/my-medium.cnf/etc/my.cnf   edit the MySQL profile "/etc/my.cnf"   to ensure that MySQL works correctly, you need to specify The "Mysql.sock" file is generated and the default encoding is modified to UTF-8. Use the following command: vim/etc/my.cnf[mysqld] #下添加以下命令socket =/var/lib/mysql/mysql/mysql.sockdatadir=/mysql_data/mysql    #如果你的数据存储位置要改变的话需要在这里指定存储目录character-set-server=utf8

Lower_case_table_names=1 # (Note that Linux is the default after MySQL is installed: Differentiate the case of the table name, not the case of the column name; # lower_case_table_names = 0 0: case-sensitive, 1: Case-insensitive) Note: 1) The last line, I did not add this setting in the local installation can still run, add to see you. 2) There is also in this configuration file and [client] configuration which can also set the socket, datadir two options, I do not have here (do not configure here, because just install MYSQL test), do not know the reason is the version or what, if you need to figure out how this use , then you first Baidu a bit; 3) If you modify the data storage location directory, you can execute the following command to modify the MySQL startup script "/etc/rc.d/init.d/mysql" Finally, you need to modify the MySQL startup script/etc/rc.d/init.d/ MySQL, modify Datadir=/mysql_data/mysql. Vim/etc/rc.d/init.d/mysql 7) Restart MySQL serviceService MySQL start error: starting MySQL error! The server quit without updataing PID file .... After Baidu after the solution is: vi/etc/selinux/config selinux=enforcing changed to selinux=disabled after save to restart the machine to try, it has to be restarted, it's critical.。 After the arduous restart hope to be able to work, the result of the server can not start .... Display Error: Kernel panic-not syncing:attempted to kill Init PS: Too dejected, install a MySQL fee so much strength ... After Baidu and find a new solution to the copy: the solution when the system starts, press the ' E ' key to enter the grub editing interface, edit the Grub menu, select "Kernel/vmlinuz-2.6.23.1-42.fc8 ro root=/dev/vogroup00/log Vol00 RHGB quiet "column, press ' E ' key to enter the editor, add enforcing=0 at the end, i.e.: Kernel/vmlinuz-2.6.23.1-42.fc8 ro root=/dev/vogroup00/logvol00 RHGB quiet enforcing=0
Press ' B ' key to continue booting, OK to go forward smoothly. Okay, well, finally, get into the Linux system, start the MySQL service: service MySQL start also tip error:Mysql:starting MySQL ..... error! The server quit without updating PID file solution is because MySQL does not have an initialization table/usr/bin/mysql_install_db--user=mysqlservice MySQL start can Restart the MySQL service. PS: It's not easy to install a mysql ... 8) Modify login passwordMySQL does not have a password by default, the importance of increasing the password is self-evident. Before modifying, log in directly to check if the MYSQL port is on: [[email protected]hadoop ~] #netstat-NTLP | grep 3306tcp 0 0::: 3306:::* LISTEN 5052/mysqld $:mysql Error: E Rror 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) Discover and set up the SOC for MySQL server Ket location is not the same. Change the/etc/my.cn change socket =/var/lib/mysql/mysql.sock-save; re-enter: [[email protected] init.d]# MySQL and error ...
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no) Baidu solution:[[email protected]  ~] #mysqld_safe--user=mysql--skip-grant-tables--skip-networking &  mysql-u root mysql  Enter again: [[email  protected] ~]# mysqlwelcome to the MySQL Monitor.  commands End With; or \g.your MySQL connection ID is 2Server version:5.6.22 mysql Community Server (GPL)  copyright (c), 2014,&nbsp ; oracle and/or its affiliates. All rights Reserved. oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names is trademarks of their respectiveowners. type ' help, ' or ' \h ' for help. The Type ' \c ' to clear of the current input Statement.mysql> ok finally installed successfully ...   Log in to the MySQL database directly by typing "MySQL" before adding a password.   Modify Login password: [[email protected] ~]mysqladmin-u root password ' root ' format: Mysqladmin-u username-P Old password password new password & nbsp;  If you are already connected to MYSQL, you can use the following statement: Mysql> use mysql; mysql> update user SET password=password (' root ') where user= ' root '; Query OK, 4 rows affected (0.04 sec) rows Matched:4  changed:4  warnings:0 modified successfully;    transferred from: http://www . linuxidc.com/linux/2015-01/111744.htm

Installing MySQL 5.6.22 under CentOS 6.4

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.