Install mysql5.7.17 and simple configuration under Linux

Source: Internet
Author: User

1.mysql5.7.17 installed in the/usr/local/mysql directory, can also be installed in other places (the installation package is best with the Linux system, eg;64 bit is "mysql-5.7.17-linux-glibc2.5-x86_64." Tar.gz ", available on the website for download)

Mkdir/usr/local/mysql

2. Unzip and copy

      1. TAR-XVF mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
      2. MV mysql-5.7.17-linux-glibc2.5-x86_64/*/usr/local/mysql/

3. Create the Data directory (very important!) )

Mkdir/usr/local/mysql/data

4. Re-create MySQL users and user groups

Command: Groupadd MySQL #添加用户组

Useradd-r-s/sbin/nologin-g MySQL mysql-d/usr/local/mysql #新建msyql用户禁止登录shell

5. Change MySQL directory permissions

Chown-r mysql.mysql/usr/local/mysql/

6. Next Initialize the database:

Command:./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/ data/

7. Copy the configuration file to/etc/my.cnf

      1. Cp-a./SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF (select y)

8. After switching to the MySQL directory, copy the service file to the startup directory

      • cp support-files/mysql.server /etc/init.d/mysql.server
        Set environment variable/etc/profile
      • export PATH=$PATH:/usr/local/mysql/bin
        启动停止

      • Service Mysql.server start;

        Service Mysql.server stop; start

      • 9 Start
      • 10. Change root password

        View initial Password

        Command: Cat/root/.mysql_secret

      • Command: Bin/mysql-uroot-p

        Password is just copy of the password, paste in the return.

      • 11. Following the above installation is not possible to remote access, you need to modify the Allow remote connection, the steps are as follows:

The way that MySQL does not differentiate between table name capitalization is actually simple:
1. Log in with root, modify/ETC/MY.CNF
2. Add a line under [mysqld]: Lower_case_table_names=1
3. Restart the database to

Install mysql5.7.17 and simple configuration under Linux

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.