Installation in mysql5.7linux

Source: Internet
Author: User
Tags mysql create

Installation in mysql5.7linux
Step 1: Prepare the environment. centOS 6.5 running mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz, jdk1.7 2. install jdk 3. rpm-qa | grep-I mysql installation can be uninstalled Step 2: create user and user group groupadd mysql Add User Group useradd-r-g mysql create a user (useradd-s/sbin/nologin-g mysql) Step 3: download installation package wget http://www.kakapart.com/files/mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz

Or download to the official website to the server: http://tomcat.apache.org/

Step 4: Start installation 1. create mysql and install mul mkdir/usr/local/mysql 2. decompress the installation package tar -zxvfmysql-5.7.10-linux-glibc2.5-x86_64.tar.gz/usr/local/mysql 3. create the data DIRECTORY mkdir data in the mysql directory 4. modify the permissions of all files in the mysql directory chown-Rmysql: mysql 4. modify vi/etc/my. cnf file [mysqld] basedir =/usr/local/mysql/
Datadir =/usr/local/mysql/data 5. run the following command to initialize the data in the mysql installation directory cd/usr/local/mysql: bin/mysqld -- user = mysql -- basedir =/usr/local/mysql/-- datadir =/usr/local/mysql/data/-- secure-file-priv =/root /-- initialize note: if -- initial-insecure is added during initialization, the root @ localhost account -- secure-file-priv with an empty password will be created under the folder specified by the password folder. after mysql_secret file (before 5.6), A temporary password is generated for root @ localhost: (U? 0 T, 6, qQ2: (U? 0 T, 6, qQ2: This is the first password to log on to mysql.

6. Start mysql

Add boot start: run the command cp support-files/mysql. server/etc/init. d/mysql to put the startup script to the boot initialization directory.

Start mysql service: Execute the Command service mysql start

Run the following command: ps-ef "grep mysql: mysql service started successfully.

If ERROR 2002 (HY000): Can "t connect to local MySQL server through socket '/tmp/mysql. sock' (2) occurs

Modify vi/etc/my. cnf

Restart the Service to continue logging on:

ERROR: ERROR 1820 (HY000): You must reset your password using alter user statement before executing this statement indicates that You need to change the password set password = password ("123456 ') first ');

Mysql is successfully installed.

Step 5: remote connection in the cmd command line, enter mysql-h192.168.139.132-uroot-p123456
The following error occurs: Warning: Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host "192.168.139.1 'is not allowed to connect to this MySQL server
To ensure security, by default, machines other than the mysql local machine are not allowed to access the mysql database service. Therefore, you need to re-authorize the root user.
Authorization: grant all privileges on *. * TO root @ '%' identified by '000000'; successful remote connection mysql installation successful
For more information about how to install mysql 5.6, see install mysql 5.6 in linux.



Related Article

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.