MySQL5.7.10 installation document tutorial details, mysql5.7.10 details
1. Install the dependency package
yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison
2. Install the boost Library:
First, check whether boost has been installed.
rpm -qa boost*
Uninstall the old boost-* and other libraries:
yum -y remove boost-*
Download the Boost library, decompress it, copy it to the/usr/local/boost directory, and then re-run cmake and add the option-DWITH_BOOST =/usr/local/boost in the following options
(Download: http://sourceforge.NET/projects/boost/files/boost)
Note: The boost version required by mysql5.7.10 is 1.59.0 and cannot be another version.
: Http://liquidtelecom.dl.sourceforge.Net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
3. Download MySQL source code
Official Website: http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.10.tar.gz
Decompress the downloaded package
4. Installation Process
(1) create users and groups
# Groupadd mysql # mkdir/home/mysql # custom location # mkdir/home/mysql/data # custom location # useradd-g mysql-d/home/mysql
(2) Compile mysql
cmake -DCMAKE_INSTALL_PREFIX=/home/mysql -DMYSQL_DATADIR=/home/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
(3) Installation
If no error is reported in step 2
make && make install
(4) initialize the database
Go to the bin directory under the installation record and execute
./mysqld --initialize --user=mysql --basedir=/home/mysql --datadir=/home/mysql/data
Note: the default password will be generated after initialization. Please record it
MySQL5.7.10 installation documentation
(5) Adjust the configuration file and environment variable parameters
Back up my. cnf generated by default
# mv /etc/my.cnf /etc/my.cnf.bak
Enter the mysql installation directory support file directory
# cd /mysql/support-files
Copy the configuration file template to the new mysql configuration file,
# cp my-default.cnf /etc/my.cnf
You can modify the new configuration file options as needed. If you do not modify the configuration options, mysql runs based on the default configuration parameters.
The following is my configuration file/etc/my. cnf, which is used to set the encoding to utf8 to prevent garbled characters:
[mysqld]character_set_server=utf8init_connect='SET NAMES utf8'[client]default-character-set=utf8
Copy the startup script to init. d.
cp /mysql/support-files/mysql.server /etc/init.d/mysqld
Add execution permission
chmod 755 /etc/init.d/mysqld
Create a mysql command file
ln -s /mysql/bin/mysql /usr/bin/
Note: without this file, there is no mysql command and mysql cannot be used to access the database anywhere.
(6) Start mysql
service mysqld start
(7) accessing the database
mysql -uroot -p
The password is the generated password.
(8) change the default password
alter user 'root'@'localhost' identified by '123456';
Note: If the default password is not modified, the SQL statement cannot be used normally and must be modified.
The above is a detailed tutorial on the MySQL5.7.10 installation document. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!