Mysql rpm installation and mysqlrpm Installation

Source: Internet
Author: User
Tags crc32 deprecated mysql login rsyslog

Mysql rpm installation and mysqlrpm Installation

Summary of the mysql rpm installation method and some errors

 

Environment
[Root @ host2 ~] # Uname-
Linux host2 2.6.32-504.3.3.el6.x86 _ 64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[Root @ host2 ~] # Cat/etc/issue
CentOS release 6.5 (Final)
Kernel \ r on an \ m

1. Check for Installation

[Root @ host2 ~] # Rpm-qa | grep -- color mysqlMySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar


2. Delete the installed

[Root @ host2 ~] # Rpm-e mysql-libs-5.1.71-1.el6.x86_64 -- nodeps
[Root @ host2 ~] #

3. Check whether deletion will leave some things

[Root @ host2 ~] # Find/-name mysql
[Root @ host2 ~] # 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 successful. It is best to delete these files.

4. check whether there are mysql users and groups
[Root @ host2 ~] # Nl/etc/group | grep mysql
[Root @ host2 ~] # Nl/etc/shadow | grep mysql


5. Unpack
[Root @ host2 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 compatible package
MySQL-client-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL client program
MySQL-shared-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL shared library
MySQL-server-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL server program
MySQL-test-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL testing components
MySQL-devel-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL library and header files
MySQL-embedded-5.6.22-1.linux_glibc2.5.x86_64.rpm # MySQL embedded Program

6. The database will be automatically initialized after installation.

[root@host2 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 DEFAULT value is deprecated. Please use --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 is disabled2015-01-20 13:10:42 5645 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2015-01-20 13:10:42 5645 [Note] InnoDB: Memory barrier is not used2015-01-20 13:10:42 5645 [Note] InnoDB: Compressed tables use zlib 1.2.32015-01-20 13: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 first specified data file ./ibdata1 did not exist: a new database to be created!2015-01-20 13:10:42 5645 [Note] InnoDB: Setting file ./ibdata1 size to 12 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 48 MB2015-01-20 13:10:42 5645 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 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) are active.2015-01-20 13:10:43 5645 [Warning] InnoDB: Creating foreign key constraint system tables.2015-01-20 13:10:43 5645 [Note] InnoDB: Foreign key constraint system tables created2015-01-20 13:10:43 5645 [Note] InnoDB: Creating tablespace and datafile system tables.2015-01-20 13:10:43 5645 [Note] InnoDB: Tablespace and datafile 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 will 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 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 buffer pool pages2015-01-20 13:10:45 5667 [Note] InnoDB: The InnoDB memory heap is disabled2015-01-20 13:10:45 5667 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2015-01-20 13:10:45 5667 [Note] InnoDB: Memory barrier is not used2015-01-20 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: Initializing 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 rollback segment(s) are 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 HAS BEEN SET FOR THE MySQL root USER !You will find that password in '/root/.mysql_secret'.You must change that password on your first connect,no other statement but 'SET PASSWORD' will be accepted.See the manual for the semantics of the 'password expired' flag.Also, the account for the anonymous user has been removed.In addition, you can run:  /usr/bin/mysql_secure_installationwhich will also give you the option of removing the test database.This is strongly recommended for production servers.See the manual for more instructions.Please report any problems at http://bugs.mysql.com/The latest information about MySQL is available on the web at  http://www.mysql.comSupport MySQL by buying support/licenses at http://shop.mysql.comNew default config file was created as /usr/my.cnf andwill be used by default by the server when you start it.You may edit this file to change server settings

 

7. RPM Installation File Distribution

Table 2.6 MySQLInstallation Layout for Linux RPM Packages from the MySQL release zone

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 installation
/Usr/share/SQL-Example Benchmarks



8. copy the configuration file
# You can also follow the built-in parameters without this step
[Root @ host2 mysql_rpm] # cp/usr/share/mysql/my-default.cnf/etc/my. cnf

9. Start mysql
[Root @ host2 mysql_rpm] # service mysql status
MySQL is not running [FAILED]
[Root @ host2 mysql_rpm] # service mysql start
Starting MySQL... [OK]

10. Check the process
[Root @ host2 mysql_rpm] # netstat-anpl | grep mysql
Tcp 0 0: 3306: * LISTEN 5924/mysqld
Unix 2 [ACC] stream listening 76015 5924/mysqld/var/lib/mysql. sock

11. Install the client
[Root @ host2 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
[Root @ host2 mysql_rpm] # nl/root/. mysql_secret
1 # The random password set for the root user at Tue Jan 20 13:10:43 2015 (local time): F76Wy1A4G9ZuLcaG --- this is The first mysql login, root password

[root@host2 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) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;ERROR 1820 (HY000): You 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

 

The server quit without updating PID file was encountered during The startup process. I believe many people may also have encountered this error. Let's make a summary:
Cause: the MySQL datadir data directory does not have a pid file or is not authorized
Solution:
(1) be sure to authorize/data/mysql for example.
Chown-R mysql: mysql/data/mysql
(2) If the authorization is not good, you can create a pid in/data/mysql by yourself, such as my host name is centos-6.3
Cd/data/mysql & touch centos-6.3.pid
Enter a pid number that is not in the process at will.
(3) If the problem persists, you need to check the configuration in the/etc/my. cnf configuration file and remove the # Before port, datadir, basedir, and socket.

(4) Another solution may be caused by the following reasons:
1> mysql may be installed on the machine for the second time, and the Service Startup may be affected due to residual data.
Solution: Go to the mysql data DIRECTORY/data to see, if there is a mysql-bin.index, just remove it, it is the culprit

2> mysql uses/etc/my when the configuration file is not specified at startup. cnf configuration file. Open this file to check whether the data directory (datadir) is specified in [mysqld ).
Solution: Set this line in [mysqld]: datadir =/usr/local/mysql/data
 

3> skip-federated Field Problems

Solution: Check whether the skip-federated field has been commented out in the/etc/my. cnf file. If so, comment out the field immediately.

4> selinux: if it is a centos system, selinux is enabled by default (this is the error we encountered today)
Solution: Close it, open/etc/selinux/config, change SELINUX = enforcing to SELINUX = disabled, and then save the disk and restart the machine.

 

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.