CENTOS7 installation mysql5.7 and configuration

Source: Internet
Author: User
Tags gpg mysql download administrator password disk usage ssl connection

One, the different versions of Mysql:
1. MySQL Community Server Community version, open source free, but does not provide official technical support.
2, MySQL Enterprise Edition Business version, pay, you can try 30 days.
3, MySQL Cluster cluster version, open source free. Several MySQL servers can be packaged as one server.
4. MySQL Cluster CGE Premium Cluster edition, fees apply.
5. mysql Workbench (GUI tool) A er/database modeling tool designed for MySQL. It is a successor to the famous database design tool DBDesigner4.
MySQL Workbench is also divided into two versions, namely the Community Edition (MySQL Workbench OSS), the Business Edition (MySQL Workbench SE).

MySQL Community Server is open source free, which is also the version of MySQL we usually use. Subdivided into multiple versions based on different operating system platforms,

There are three ways to install MySQL under Linux:
1 Download the installation online via the Yum command
2 Download offline RPM installation package installation
3 Download Source Compilation installation

MySQL Yum Repository
MySQL official new provides a way to install MySQL-using the Yum source to install MySQL.
1, MySQL official website download mysql source of yum, on the MySQL download page has a "new! MySQL YUM Repository ", click inside to find the corresponding system RPM package to download.
If your Linux system is networked, copy the download link: # wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm (This is El7 's MySQL Yum source, this version is 5.7 version)
2, after downloading is a mysql-community-release-el6-5.noarch.rpm file, you can use the following command to see which packages the file contains:
# RPM-QPL mysql57-community-release-el7-7.noarch.rpm
/etc/pki/rpm-gpg/rpm-gpg-key-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
Install RPM package, # RPM-IVH mysql57-community-release-el7-7.noarch.rpm
After installing the above package, look at the Yum Library, # Yum list mysql* will generate the following packages in the Yum repository:
mysql-client-5.7.11-1.el7.x86_64.rpm
mysql-devel-5.7.11-1.el7.x86_64.rpm
mysql-embedded-5.7.11-1.el7.x86_64.rpm
mysql-server-5.7.11-1.el7.x86_64.rpm
mysql-shared-5.7.11-1.el7.x86_64.rpm
mysql-shared-compat-5.7.11-1.el7.x86_64.rpm
mysql-test-5.7.11-1.el7.x86_64.rpm
After that, you can install MySQL with yum:
# yum Install Mysql-community-server
The advantage of this is that you can use Yum to manage the MySQL package, especially if you can build the MySQL installation package into the Yum Library, and more MySQL installation methods.

RPM Package Mode installation
# wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.11-1.el7.i686.rpm
# yum Localinstall mysql-community-server-5.7.11-1.el7.i686.rpm
Installing with Yum Localinstall will automatically install a dependency pack, which is more hassle than using # RPM-IVH mysql-community-server-5.7.11-1.el7.i686.rpm Way


Set MySQL password
Method One:
1. Stop MySQL Service
# Service Mysqld Stop
2. mysql configuration file is changed to password-free login.
# vi/etc/my.cfg
# Disabling Symbolic-links is recommended to prevent assorted security risks
Skip-grant-tables #添加这句话, you don't need a password when you log in to MySQL.
Symbolic-links=0
3. Start the MySQL service
# service Mysqld Start
4, log in as root MySQL, enter the password when the direct return
# mysql-uroot-p #输入命令回车进入, enter the password prompt for a direct return.
mysql> Set password for [email protected] = password (' 123456 ');
ERROR 1290 (HY000): The MySQL server is running with the--skip-grant-tables option so it cannot execute this statement
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
mysql> Set password for [email protected] = password (' 123456 '); or update user set Authentication_string=password ("123456") where user= "root";
Query OK, 0 rows affected, 1 Warning (0.00 sec)
Mysql>flush privileges; #更新权限
mysql>quit; #退出
# service Mysqld Stop # stops MySQL service, restores MySQL configuration
# vi/etc/my.cfg
# Disabling Symbolic-links is recommended to prevent assorted security risks
# skip-grant-tables # comment out this sentence
Symbolic-links=0
# service mysqld Start # starts MySQL service
# mysql-uroot-p # Enter a new password to sign in
Method Two:
#/path/mysqladmin-u username-h Host password ' new_password '-p
Other ways:
MySQL Administrator password settings or modifications:
According to the official note 5.6 Later, the first boot will produce a random password, the file name, in the root directory. Mysql_secret.
[Email protected] ~]# Cat/root/.mysql_secret
# Password set for user ' [e-mail protected] ' at 2015-03-27 23:12:10
: JJ+FTIQVYRF
[Email protected] ~]# cd/usr/local/mysql/bin/
[Email protected] bin]#/mysqladmin-u root-h localhost password ' 123456 '-p
Enter Password: #此行输入. Second line in Mysql_secret
Mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning:since password is sent to server in plain text, use SSL connection to ensure password safety.
The official way, the author whether or not to use--skip-grant-tables to start MySQL test failed, the pro can test:
Shell>mysql-uroot-p ' password ' #password即. Password in Mysql_secret
Mysql>set PASSWORD = PASSWORD (' newpasswd ');
There is another way:
Do not generate random passwords when installing, with sudo mysqld--initialize-insecure
Then set the password on your own sudo/usr/bin/mysqladmin-uroot password password

Http://www.myhack58.com/Article/sort099/sort0102/2015/60511.htm


Second, what is MySQL fabric?
MySQL fabric can "organize" multiple MySQL databases, and the application system will spread more than a few terabytes of tables across multiple databases, data Shard. In the same shard can contain multiple databases, and by the fabric automatically pick a suitable as the primary database, the other database configuration from the database, to master from replication. When the primary database hangs, pick one from each database to promote the primary database. After that, the other moves from the database to the new primary database to replicate the new data. Note: The word "automatic" here means that it is done in the background by MySQL fabric without requiring the user to manually change the configuration. Most importantly, MySQL fabric is the GPL's open source software, which is under the GPL, and you are free to use and modify the software.
Http://www.2cto.com/database/201408/327941.html


Third, MySQL Router
MySQL Router is a lightweight MySQL middleware that provides transparent routing to the backend of any MySQL server and can be used for read-write separation.
MySQL Router is best used with MySQL Fabric, but it's not hard to ask. Router is best to run on the same machine as the application.
MySQL Router is a lightweight middleware for high-availability and extensibility features. Doesn't MySQL fabric have the same effect? Yes, but one of the biggest drawbacks of MySQL fabric is that the application needs to be transformed, powered by a fabric-exclusive Java or Python, and currently only supports the Java,python and PHP languages, which is the high-availability and extended capabilities that MySQL fabric implements at the drive level. and MySQL router is a middleware, the intermediate Access protocol is consistent with MySQL, the application does not need to make any changes.
Http://www.codesec.net/view/408108.html


Four, MySQL Utilities
MySQL Utilities is an official MySQL management tool that features everything from five levels of tools: Database level (copy, compare, diff, Export, import), audit log plane, server level (instance cloning, instance information), System level (disk usage, redundant index , search metadata, processes), high-availability levels (master-slave replication, failover, master-slave synchronization). This tool gives you the management of MySQL.
https://www.ttlsa.com/mysql/mysql-manager-tools-mysql-utilities-tutorial/


V. What is the difference between Mysql-server and mysql-client?
Mysql-server is managed using the MYSQLD command.
Mysql-client is used with the MySQL command to connect to the MYSQLD service.
In short, one is the service, the integrity of the database runs management, and the other is the tool you use to access the database.
Make an analogy like the Web service of the website and the browser you use to browse the Web.

CENTOS7 installation mysql5.7 and configuration

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.