liunx mysql 5.7 binary installation

liunx 5.6 version installs himself no less than 20 times, basically in accordance with normal operating procedures not be any problem, all the best.

Today, the development of new projects need to follow the 5.7 version of mysql. mysql 5.7 version and mysql 5.6 version of the big change, according to the flow a little rest.

For example: mysql 5.6 initialized with the following mysql_install_db command scripts directory, and initialized with MySQL bin directory 5.7

的mysqld --initialize

But the first time I try to follow mysql5.7 version is still experiencing some problems such as:

Install mysql 5.7.17 version

Initialization begins after the preceding normal operations when the initialization mysql 5.6 and substantially uniform, into a directory database data I / work / data below, and a separate installation directory

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/work/mysql/data  --pid-file=/usr/local/mysql/data/mysql.pid --tmpdir=/tmp

However initialization failure, the following error message

Depending on the installation experience, initialization occurs rarely wrong, generally start mysql Times in a variety of errors, but also because basically did not handle the initialization file my.cnf good.

Posted about my my.cnf

[mysqld]
DATADIR = / Work / MySQL / Data
the basedir = / usr / local / MySQL
Socket = / tmp / mysql.sock
#-symbolic links Disabling to Prevent Assorted IS Recommended Security Risks
symbolic-links = 0
# Group and User Settings are the when systemd IS Used ignored.
# the If you need to RUN A Different mysqld an under the User or Group,
# Customize your systemd Unit at The File for MariaDB ACCORDING to
# Instructions in http://fedoraproject.org/wiki/Systemd
Skip-name-Resolve
= sET-Server-Character utf8mb4
# maximum number of connections
max_connections = 3000
# maximum internal memory temporary table arranged to 128M.
# For example, a large amount of data group by, may be used when the order by the temporary table
# exceeds this value will be written to disk IO system pressure increases
tmp_table_size = 134217728
max_heap_table_size = 134217728

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

[mysqld_safe]
user=mysql
tmpdir = /tmp
log-bin= /usr/local/mysql/data/mysql-bin
log-error= /usr/local/mysql/data/error.log
pid-file= /usr/local/mysql/data/mysql.pid

Check out a few times, I did not see any problems, but this my.cnf file has been used many times during the installation mysql 5.6 when the problem can not occur.

Guess: version of the problem. Delete the mysql 5.7.17, the way will be deleted during initialization data directory / work / mysql / data inside the file, re-download another version.

Re-download a mysql 5.7.24 version download link: wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz.

To install just execute initialization successful. The message is below:

Here the initial password has to come out, root @ localhost in: the random string is back

After a successful initialization and then execute, modify permissions, permission to leave only the data directory mysql

chown -R root:root .

chown -R mysql:mysql data

Adding to start mysql service

 cp support-files/mysql.server /etc/init.d/mysql

Note: This add is /etc/init.d/mysql start mysql when using the command: service mysql start

If cp support-files / mysql.server /etc/init.d/mysqld start command: service mysqld startd

You can look at the open list: chkconfig --list there is no mysql

Start mysql: service mysql start error:

mysqld_safe error: log-error set to '/usr/local/mysql/data/error.log', however file don't exists. Create writable for user 'mysql'.
The server quit without updating PID file (/work/mysql/data[FAILED]yx9nw1yvph1w96fZ.pid)

For obvious reasons, I did not find this error log file, this file is installed when the system is in mysql 5.6 automatically created.

Creating error.log file: touch /usr/local/mysql/data/error.log

Give execute permissions mysql: chown -R mysql: mysql /usr/local/mysql/data/error.log 

Mysql start again

Starting MySQL.                                            [  OK  ]

Here is the landing msyql, modify the initial password, create a remote login and some other operations

slightly. . . .

 

Guess you like

Origin www.cnblogs.com/prettrywork/p/10942746.html