Mysql RPM Installation

Source: Internet
Author: User
Tags crc32 deprecated local time rsyslog

Summarize the way the MySQL rpm is installed, with some errors

Environment
[Email protected] ~]# uname-a
Linux host2 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 01:55:02 UTC x86_64 x86_64 x86_64 gnu/linux
[Email protected] ~]# cat/etc/issue
CentOS Release 6.5 (Final)
Kernel \ r on an \m

1, check whether the installation

[Email protected] ~]# Rpm-qa | grep--color Mysqlmysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar


2. Remove installed

[Email protected] ~]# rpm-e mysql-libs-5.1.71-1.el6.x86_64--nodeps
[Email protected] ~]#

3, check, so the deletion or will leave some things

[[email protected] ~]# Find/-name MySQL
[Email protected] ~]# Find/-name *mysql*
/etc/selinux/targeted/modules/active/modules/mysql.pp
/usr/lib/python2.6/site-packages/sos/plugins/mysql.pyc
/usr/lib/python2.6/site-packages/sos/plugins/mysql.pyo
/usr/lib/python2.6/site-packages/sos/plugins/mysql.py
/usr/share/vim/vim72/syntax/mysql.vim
/usr/share/selinux/devel/include/services/mysql.if
/usr/share/selinux/targeted/mysql.pp.bz2
/usr/share/doc/rsyslog-5.8.10/rsyslog_mysql.html
/usr/share/doc/rsyslog-5.8.10/ommysql.html
/usr/share/man/man5/mysql_table.5.gz
/usr/lib64/libreoffice/program/libmysqllo.so
/selinux/booleans/allow_user_mysql_connect
/selinux/booleans/mysql_connect_any
/var/lib/yum/yumdb/m/b642f65e3df41063e068158061ae2e08f22e3dad-mysql-libs-5.1.71-1.el6-x86_64

Ensure that the following installation is smooth, it is best to delete these files

4. Check if there are any MySQL users and groups
[Email protected] ~]# Nl/etc/group | grep MySQL
[Email protected] ~]# Nl/etc/shadow | grep MySQL


5, unpacking
[Email protected] mysql_rpm]# TAR-XVF Mysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar
mysql-shared-compat-5.6.22-1.linux_glibc2.5.x86_64.rpm #RHEL兼容包
mysql-client-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL客户端程序
mysql-shared-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL的共享库
mysql-server-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL服务端程序
mysql-test-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL的测试组件
mysql-devel-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL的库和头文件
mysql-embedded-5.6.22-1.linux_glibc2.5.x86_64.rpm #MySQL的嵌入式程序

6, install, automatic initialization of database

[[email protected] mysql_rpm]# 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 rootwarning:group MySQL does not exist-using root2015-01-20 13:10:42 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-01-20 13:10:42 5645 [ Note] Innodb:using Atomics to ref count buffer pool pages2015-01-20 13:10:42 5645 [note] innodb:the InnoDB memory Heap I s disabled2015-01-20 13:10:42 5645 [Note] innodb:mutexes and rw_locks use GCC atomic builtins2015-01-20 13:10:42 5645 [No TE] innodb:memory barrier is no used2015-01-20 13:10:42 5645 [Note] innodb:compressed tables use zlib 1.2.32015-01-20 1 3:10:42 5645 [note] innodb:using Linux native aio2015-01-20 13:10:42 5645 [note] INnodb:not using CPU crc32 instructions2015-01-20 13:10:42 5645 [Note] innodb:initializing buffer pool, size = 128.0m2015 -01-20 13:10:42 5645 [note] innodb:completed initialization of buffer pool2015-01-20 13:10:42 5645 [note] innodb:the Fir St specified data file/ibdata1 did not exist:a new database to be created!2015-01-20 13:10:42 5645 [Note] Innodb:setti ng file./ibdata1 size to mb2015-01-20 13:10:42 5645 [Note] Innodb:database physically writes the file full:wait ... 2015-01-20 13:10:42 5645 [note] innodb:setting log file./ib_logfile101 size to ~ mb2015-01-20 13:10:42 5645 [note] Inno db:setting log file./ib_logfile1 size to mb2015-01-20 13:10:43 5645 [Note] innodb:renaming log file./ib_logfile101  To./ib_logfile02015-01-20 13:10:43 5645 [Warning] innodb:new log files created, lsn=457812015-01-20 13:10:43 5645 [Note] Innodb:doublewrite Buffer not found:creating new2015-01-20 13:10:43 5645 [Note] innodb:doublewrite buffer created2015- 01-20 13:10:43 5645 [Note] innodb:128 rollback segment (s) is active.2015-01-20 13:10:43 5645 [Warning] innodb:creating foreign KEY constraint sys TEM tables.2015-01-20 13:10:43 5645 [Note] innodb:foreign key constraint system tables created2015-01-20 13:10:43 5645 [N OTE] innodb:creating tablespace and datafile system tables.2015-01-20 13:10:43 5645 [Note] Innodb:tablespace and Datafil E system tables created.2015-01-20 13:10:43 5645 [note] innodb:waiting for purge to start2015-01-20 13:10:43 5645 [note] Innodb:5.6.22 started; Log sequence number 0A random root password has been set. You'll find it in '/root/.mysql_secret '. 2015-01-20 13:10:44 5645 [note] Binlog end2015-01-20 13:10:44 5645 [note] InnoDB : FTS optimize thread exiting.2015-01-20 13:10:44 5645 [Note] innodb:starting shutdown ... 2015-01-20 13:10:45 5645 [Note] Innodb:shutdown completed; Log sequence number 16259772015-01-20 13:10:45 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for more details). 2015-01-20 13:10:45 5667 [Note] innodb:using Atomics to ref count Buffe R Pool pages2015-01-20 13:10:45 5667 [note] innodb:the InnoDB memory heap is disabled2015-01-20 13:10:45 5667 [note] Inno Db:mutexes and Rw_locks use GCC atomic builtins2015-01-20 13:10:45 5667 [Note] innodb:memory barrier are not used2015-01-  13:10:45 5667 [note] innodb:compressed tables use zlib 1.2.32015-01-20 13:10:45 5667 [note] innodb:using Linux native aio2015-01-20 13:10:45 5667 [note] innodb:not using CPU crc32 instructions2015-01-20 13:10:45 5667 [note] Innodb:initia  Lizing buffer pool, size = 128.0m2015-01-20 13:10:45 5667 [Note] innodb:completed initialization of buffer pool2015-01-20 13:10:45 5667 [note] innodb:highest supported file format is barracuda.2015-01-20 13:10:45 5667 [note] innodb:128 rollb ACK segment (s) is active.2015-01-20 13:10:45 5667 [note] innodb:waiting for purge to start2015-01-20 13:10:45 5667 [Note ] innodb:5.6.22 started; Log sequence number 16259772015-01-20 13:10:45 5667 [note] Binlog end2015-01-20 13:10:45 5667 [note] Innodb:fts optimize Thread exiting.2015-01-20 13:10:45 5667 [Note] innodb:starting shutdown ... 2015-01-20 13:10:47 5667 [Note] Innodb:shutdown completed; Log sequence number 1625987A 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_installationwhich would also give you the option of removing the test data Base. 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.comSupport MySQL by buying sUpport/licenses at Http://shop.mysql.comNew Default Config file is created as/usr/my.cnf Andwill be used by default by T He server when you start it. You could edit this file to the Change server settings

 

7,RPM installation mode file distribution

Table 2.6 mysqlinstallation Layout for Linux RPM Packages from the MySQL developerzone

Directory contentsof Directory
/usr/bin Clientprograms and Scripts
/usr/sbin Themysqldserver
/var/lib/mysql Logfiles, databases
/usr/share/info Manualin Info Format
/usr/share/man Unixmanual pages
/usr/include/mysql Include (header) files
/usr/lib/mysql Libraries
/usr/share/mysql Miscellaneoussupport files, including error messages, character set files,sample configuration files, SQL for database ins Tallation
/usr/share/sql-bench Benchmarks



8,copy configuration file
# Without this step you can also press the built-in parameters
[Email protected] mysql_rpm]# CP/USR/SHARE/MYSQL/MY-DEFAULT.CNF/ETC/MY.CNF

9. Start MySQL
[[Email protected] mysql_rpm]# service MySQL status
MySQL is not running [FAILED]
[[Email protected] mysql_rpm]# service MySQL start
Starting MySQL. [OK]

10, check the process
[Email protected] mysql_rpm]# NETSTAT-ANPL | grep MySQL
TCP 0 0::: 3306:::* LISTEN 5924/mysqld
UNIX 2 [ACC] STREAM LISTENING 76015 5924/mysqld/var/lib/mysql/mysql.sock

11, install the client
[Email protected] mysql_rpm]# RPM-IVH mysql-client-5.6.22-1.linux_glibc2.5.x86_64.rpm
Preparing ... ########################################### [100%]
1:mysql-client ########################################### [100%]


12, connect to MySQL and modify
[Email protected] mysql_rpm]# Nl/root/.mysql_secret
1 # The random password set for the root user at Tue Jan 13:10:43 (local time): F76WY1A4G9ZULCAG---This is the first time to log in to MySQL , Root's password

[Email protected] mysql_rpm]# mysql-p mysqlenter password:welcome to the MySQL monitor.  Commands End With; or \g.your MySQL connection ID is 4Server version:5.6.22copyright (c), the Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> show databases; ERROR 1820 (HY000): Must set PASSWORD before executing this statementmysql> mysql>  set PASSWORD = PASSWORD (' 123456 '); Query OK, 0 rows affected (0.31 sec) mysql> Flush privileges;mysql> \qbye

During the startup process, I have encountered this error (theserver quit without updating PID file), I believe many people should also have encountered, do the following summary:
cause: There is no PID file or is not authorized in MySQL's DataDir data directory
How to resolve:
(1) Be sure to give authorization to, for example,/data/mysql
chown-r Mysql:mysql/data/mysql
(2) If the authorization is not so, you can create a/data/mysql under the host name of the PID, such as my host name is centos-6.3
you can cd/data/mysql && touch centos-6.3.pid
write a PID number that is not in the process.
(3) If still not, you need to look at the configuration file/etc/my.cnf inside the configuration, the port, DataDir, Basedir, socket before the # removed

(4) Additional treatment methods may be caused by the following reasons
1> may be the second time to install MySQL on the machine, with residual data affecting the start of the service.
workaround: Go to MySQL data directory/data See, if there is mysql-bin.index, quickly delete it, it is the culprit

2>mysql The/ETC/MY.CNF profile is used when the configuration file is not specified at startup, open this file to see if there is a specified data directory (DATADIR) under the [Mysqld] section.
WORKAROUND: Please set this line under [mysqld]: DataDir =/usr/local/mysql/data

3>skip-federated Field Issues

Workaround: Check the/etc/my.cnf file for any skip-federated fields that have not been commented out, and if so, comment them out immediately.

4>selinux, if it is a CentOS system, the default is to turn on SELinux (this is the error that is encountered today)
Workaround: Turn it off, open the/etc/selinux/config, change the selinux=enforcing to selinux=disabled, and then save the restart machine and try again.

Mysql RPM Installation

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.