For a long time did not install MySQL, need to install today to find out as soon as possible, record, amnesia when useful;
Mkdir/soft/data/mysql--Building a directory
Cd/soft
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-i686.tar.gz--Download
Tar xvf mysql-5.7.19-linux-glibc2.12-i686.tar.gz #解压
MV mysql-5.7.19-linux-glibc2.12-i686 mysql-5.7.19 #改下名字好记
Useradd MySQL #建立用户
Chown mysql:mysql-r/soft/mysql-5.7.19 && chown mysql:mysql-r/data/mysql
CD mysql-5.7.19
./bin/mysqld--initialize datadir=/data/mysql/--Initialize the database and remember the password shown in the last line [email protected]: ivy.sxjt!0v0
Vim/etc/my.cnf
Added: [Mysqld]
basedir=/soft/mysql/mysql-5.7.19
Datadir=/data/mysql
Vim/soft/mysql-5.7.19/support-files/mysql.server.
To set the path:
basedir=/soft/mysql-5.7.19--set MySQL size, diameter
Datadir=/data/mysql--Set the data storage path
12.ln/soft/mysql-5.7.19/support-files/mysql.server/sbin/mysqld--Set links for easy invocation
13.ln/soft/mysql-5.7.19/bin/mysql/sbin/mysql--Set links for easy invocation
14.mysqld Start--Start mysqld service
15.mysql-p 'ivy.sxjt!0v0'--log in to MySQL
Mysql>set Password=password (' 123456 ')--You must change your password before you can use it, and change it here to 123456
Mysql>use MySQL;
Database changed
Mysql>
During the installation, there are a few questions that are very strange, to be patient analysis, such as
When starting the MySQL service, always prompt to not update the PID file, you need to set the parameters in the Mysql.server file:
Mysqld_pid_file_path=/data/mysql, after setting, prompt to start successfully, actually not shipped. And then restore this parameter to be normal .....
Finish
Compile-free installation of MySQL 5.7.19