MySQL 5.1 Upgrade Build install 5.6 Convert the original MyISAM table to InnoDB and global backup Once "original"

Source: Internet
Author: User



MySQL 5.1 Upgrade compile install 5.6 Convert the original MyISAM table to InnoDB and back up the global one at a time



1.
"Backup specified database" Do not use commas mydb hellodb

[Email protected] ~]# mysqldump-uroot-p--databases mydb hellodb >/tmp/all.sql



"Modify Engine=myisam to Engine=innodb"

[[email protected] home]# CP hellodb.sql hellodb.sql.bak[[email protected] home]# vim hellodb.sql:%s/engine=myisam/ engine=innodb/g



2.
Delete the previously existing database, compile and install the new database
http://990487026.blog.51cto.com/10133282/1692874



3.

"If there is a InnoDB. sql database file, look directly at the following, the above will not see"
"Each INNODB uses separate data storage files, data files, binary log files stored separately"

[[email protected] ~]# service iptables stop [[email protected] ~]#  setenforce 0[[email protected] mybackups]# vim /etc/my.cnfthread_concurrency  = 4datadir= /mydata/data    #数据存放文件在初始化mysql时已经指定好了, create files, give permissions, Ok innodb_ file_per_table = onlog-bin=/mydata/binlogs/master-bin     server-id        = 1      Save Exit  [[email protected]  ~]# mkdir -pv /mydata/binlogs [[email protected] ~]# chown -r  mysql:mysql /mydata/binlogs/ [[email protected] ~]# service mysqld  restart [[email protected] ~]# ss -tnl | grep 3306 listen      0      80                        :::3306                     :::*    See if InnoDB uses a separate storage file mysql> show variables like  '%per_table% ';  +------------------ -----+-------+ | variable_name         | value  | +-----------------------+-------+ | innodb_file_per_table | on     | +-----------------------+-------+ to see if the binary log is already open Mysql> show variables like   ' log_bin '; scroll once log mysql> show master status;mysql> flush logs;mysql>  show master status; temporarily turn off binary, reply to data, and then open binary record mysql> set sql_log_bin=0;mysql>  source /home/hellodb.sqlmysql> set sql_log_bin=1;mysql> show databases; See if the table's storage is innodbmysql> show table status from hellodb \ginnodb stand-alone storage file [[email protected] ~]# ls -1  /mydata/data/ocsweb/accesslog.frmaccesslog.ibd


Back up a modified database, do not use commas mydb hellodb

[Email protected] ~]# mysqldump-uroot-p--databases mydb hellodb >/tmp/all.sql



Create a link to provide the sock interface for the original PHP program

[Email protected] ~]# Ln-sv/tmp/mysql.sock/var/lib/mysql/mysql.sock





Create a user, put ocsweb this library all permissions to it

Mysql-u root-pgrant all privileges in ' ocsweb '. * to ' user ' @ ' localhost ' identified by ' password ' with GRANT OPTION;


Recommended ways to modify the default password:

mysql> UPDATE user SET password = password (' your_password ') WHERE user = ' root ';mysql> FLUSH privileges




End!

MySQL 5.1 Upgrade Build install 5.6 Convert the original MyISAM table to InnoDB and global backup Once "original"

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.