Mysql-5.6.20 installed in rpm Mode Under CentOS6.5 and RedHat6.5, centos7mysql5. 6rpm

Source: Internet
Author: User

Mysql-5.6.20 installed in rpm Mode Under CentOS6.5 and RedHat6.5, centos7mysql5. 6rpm

1. Check whether MySQL has been installed in linux.

Rpm-qa | grep-I mysql # uninstall the old version yum-y remove mysql first...

  

2. download the required installation package ,:

https://dev.mysql.com/downloads/mysql/5.6.html#downloads

3. Start installation one by one

rpm -ivh MySQL-server-5.6.20-1.el6.x86_64.rpmrpm -ivh MySQL-devel-5.6.20-1.el6.x86_64.rpmrpm -ivh MySQL-client-5.6.20-1.el6.x86_64.rpm

4. modify the configuration file location and make relevant settings

cp /usr/share/mysql/my-default.cnf /etc/my.cnfvi /etc/my.cnf

  


# Configure as follows

[Client] password = 123456 port = character = utf8 [mysqld] port = 3306character_set_server = utf8character_set_client = utf8collation-server = utf8_general_ci # default after mysql installation in linux: table names are case sensitive, the column name is case insensitive; 0: Case Sensitive; 1: Case Insensitive lower_case_table_names = 1 # set the maximum number of connections. The default value is 151, maximum number of connections allowed by the MySQL server: 16384max_connections = 1000 [mysql] default-character-set = utf8

  

V. initialize MySQL and set the password

/usr/bin/mysql_install_dbservice mysql start

  

6. log on to mysql. If no password is installed for the first time, press Enter.

Mysql-uroot-p # set the password of the root user mysql> update user set password = password ('000000') where user = 'root ';

  

7. Allow Remote Logon

mysql> use mysql;mysql> select host,user,password from user;mysql> update user set host='%' where user='root' and host='localhost';mysql> flush privileges;
mysql> exit;

 

8. Set auto-start upon startup

chkconfig mysql onchkconfig --list | grep mysql

  

9. Description of the default installation location of MySQL

/Var/lib/mysql/# Database directory/usr/share/mysql # configuration file directory/usr/bin # related command directory/etc/init. d/mysql # STARTUP script Note: When you uninstall mysql, delete the files in these directories.

  

A. Possible errors (1)

2014-01-21 06:03:29 14964 [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!2014-01-21 06:03:29 14964 [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!2014-01-21 06:03:29 14964 [ERROR] Plugin 'InnoDB' init function returned error.2014-01-21 06:03:29 14964 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.2014-01-21 06:03:29 14964 [ERROR] Unknown/unsupported storage engine: InnoDB2014-01-21 06:03:29 14964 [ERROR] Aborting


Delete these three files in the/var/lib/mysql/directory: ibdata1 ib_logfile0 ib_logfile1 and restart mysql.

cd /var/lib/mysqlrm ibdata1 ib_logfile0 ib_logfile1service mysql start

  

B. Possible errors (2)

[Root @ localhost local] # mysql-uroot-pEnter password: ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES) the method is simple, as follows: #/etc/init. d/mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysql // change all empty user passwords to non-empty passwords. Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root' and host = 'root' or host = 'localhost'; mysql> flush privileges; mysql> quit #/etc/init. d/mysqld restart # mysql-uroot-pEnter password: <enter the new password newpassword>

  

C. Possible errors (3)

mysql> show databases;ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

This statement requires you to reset the password!

mysql> SET PASSWORD = PASSWORD('123456');Query OK, 0 rows affected (0.03 sec)mysql> create database roger;Query OK, 1 row affected (0.00 sec)

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.