Install MySQL 5.7 and MySQL
Introduction
MySQL5.7 has been around for more than half a year, and the industry has been promoting How N 5.7 is, the official website also promotes the speed improvement of 5.7 several times, including more syntax support, JOSN, and parallel replication; however, the thread pool that has always been expected does not appear in 5.7. I can't help but download one for fun. The installation of mysql5.7 is a little different from that of 5.6. This chapter mainly introduces the binary installation method.
Environment: centos6.7, mysql5.7.12
Install
The version I downloaded is mysql5.7.12 community edition. The specific download method is not described and can be found on the official website.
1. Create a mysql user first
groupadd mysqluseradd -r -g mysql -s /bin/false mysql
2. the decompression method is not mentioned here. I will temporarily put mysql in/package/mysql
cd /package/mysql
3. Create a mysql data directory, which will be used during database Initialization
mkdir data
4. modify directory permissions
chown -R mysql:mysql .
5. initialize the database
The initialization method before 5.7.6 is as follows:bin/mysql_install_db --user=mysql
I downloaded the latest version 5.7.12, which is also released on version 4.12. MySQL _ install_db is no longer used for database initialization in Versions later than 5.7.6.
bin/mysqld --initialize --user=mysql --basedir=/package/mysql --datadir=/package/mysql/data --innodb_undo_tablespaces=3
bin/mysql_ssl_rsa_setup
6. Copy the Startup file to the etc/init. d directory.
cp support-files/mysql.server /etc/init.d/mysql
7. Start mysql
bin/./mysqld_safe --skip-grant-tables --skip-networking &
8. log on to the default mysql root Password
The field used to store the password in MySQL 5.7 is no longer password, but it is changed to authentication_string.
update mysql.user set authentication_string=password('root') where user='root'';
After changing the root password, If you log on to the mysql system as the root user for the first time, you need to reset the root password.
SET PASSWORD=PASSWORD('root');
Compared with 5.6, the data directory has some more variations. files with the pem suffix do not know the functions of these files yet. The extra sys library is a big feature, this system library contains a lot of Resource Information Statistics visual charts, including the server io, memory, wait, lock, statement, etc.
Summary
Mysql5.7 has not been studied in depth yet, but it has already brought me a lot of surprises. In particular, it has increased the convenience of sys database for performance analysis, and mysql has become more and more perfect, it is expected to be used later.
Note: Author: pursuer. chen Blog: http://www.cnblogs.com/chenmh All essays on this site are original. You are welcome to repost them. However, you must indicate the source of the article and clearly give the link at the beginning of the article. Welcome to discussion |