Centos6.5 install mysql-5.7

  1. Unzip mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz, change its name to mysql, and put it in the /usr/local directory

    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
  2. 2

    Add the mysql user and group, then install mysql and start it. The initial password is saved by /root/.mysql_secret. The command used is as follows:

    groupadd mysql

    useradd mysql -g mysql

    cd /usr/local/mysql/bin

    yum install libaio

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

    cd /usr/local/mysql/support-files

    ./mysql.server start

    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
  3. 3

    Use the initial password to log in to mysql, change the password, and set root to connect remotely

    The command is as follows:

    cat /root/.mysql_secret

    cd /usr/local/mysql/bin

    ./mysql -u root -p

    set password =password('new password');

    GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "1新密码";

    flush privileges;

    May not be able to connect remotely, try to close the firewall, the command is as follows:

    service iptables stop

    setenforce 0

    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
  4. 4

    sr sets mysql to start automatically at boot and adds a soft connection

    The command is as follows:

    cd /usr/local/mysql/support-files/

    cp mysql.server /etc/init.d

    cd /etc/init.d

    mv mysql.server mysqld

    cd /usr/bin

    ln -s /usr/local/mysql/bin/mysql mysql 

    Centos6.5 install mysql5.7
    Centos6.5 install mysql5.7
     

    Set case insensitive under linux

    1. Log in with ROOT, modify /etc/my.cnf (if not, create a new vi)
    2. Add a line under [mysqld]: lower_case_table_names=1

    [mysqld]

    lower_case_table_names=1
    3. Restart the database

     

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326850080&siteId=291194637