Install Mysql in 64-bit CentOS6
Installation environment
Installation Steps
Start using commandssudo yum installMySQL-serverAfter installation, usemysql --versionCheck the version 5.1.73.
To install version 5.6, uninstall version 5.1 and download the local package to reinstall it, as shown below:
# rpm -ivh MySQL-server-5.6.15-1.el6.i686.rpm# rpm -ivh MySQL-client-5.6.15-1.el6.i686.rpm# rpm -ivh MySQL-shared-5.6.15-1.el6.i686.rpm
After the installation is complete, use the command/etc/init.d/mysql startStartup error:Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/namenode.pid).
View/var/lib/mysql/namenode.errThe error details are as follows:
2016-06-06 14:44:37 29727 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!2016-06-06 14:44:37 29727 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
Refer to MySQL 5.6 Failure'sSUGGESTION #1 : UNINSTALL AND REINSTALL MySQL 5.6Solution: remove the old data and reinstall it.
When the installation is complete, the following prompt is displayed:
A 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 with the /usr/bin/mysqlbug script!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
Meaning
- After the installation is complete, a random password is generated for the root user, in the '/root/. mysql_secret' file.
- The password must be changed during the first connection. Please execute
/usr/bin/mysql_secure_installationEnter the root initial password and modify other options in sequence.
Reference
- How to Install MySQL 5.6.15 on CentOS 6 and RHEL 6